Coverity: 711838

This commit is contained in:
Ward Fisher 2014-07-31 16:32:50 -06:00
parent 506440920f
commit dcf8ad365e

View File

@ -72,8 +72,11 @@ ncaux_begin_compound(int ncid, const char *name, int alignmode, void** tagp)
cmpd->name = strdup(name);
if(cmpd->name == NULL) {status = NC_ENOMEM; goto fail;}
if(tagp) *tagp = (void*)cmpd;
if(tagp) {
*tagp = (void*)cmpd;
} else { /* Error, free cmpd to avoid memory leak. */
free(cmpd);
}
return status;
fail: