mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-11-21 03:13:42 +08:00
Coverity: 711838
This commit is contained in:
parent
506440920f
commit
dcf8ad365e
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user