Skip to content
Snippets Groups Projects
Commit 8fd64b9e authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Fix scan-build warning: Access to field 'ncvarid' results in a dereference of a null pointer.

parent cc73bd65
No related branches found
No related tags found
No related merge requests found
......@@ -6,15 +6,17 @@
void basetimeInit(basetime_t *basetime)
{
if ( basetime == NULL )
Error("Internal problem! Basetime not allocated.");
if (basetime == NULL) Error("Internal problem! Basetime not allocated.");
basetime->ncvarid = CDI_UNDEFID;
basetime->ncdimid = CDI_UNDEFID;
basetime->ncvarboundsid = CDI_UNDEFID;
basetime->leadtimeid = CDI_UNDEFID;
basetime->lwrf = false;
basetime->timevar_cache = NULL;
if (basetime)
{
basetime->ncvarid = CDI_UNDEFID;
basetime->ncdimid = CDI_UNDEFID;
basetime->ncvarboundsid = CDI_UNDEFID;
basetime->leadtimeid = CDI_UNDEFID;
basetime->lwrf = false;
basetime->timevar_cache = NULL;
}
}
/*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment