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
......@@ -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;
}
}
/*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment