mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-12 15:45:21 +08:00
Addressed Coverity issue 752015, resource leak.
This commit is contained in:
parent
e80dbb92c0
commit
f51f97546b
@ -92,8 +92,10 @@ ocinternalinitialize(void)
|
||||
size_t pathlen = strlen("./")+strlen(*alias)+1;
|
||||
path = (char*)malloc(pathlen);
|
||||
if(path == NULL) return OC_ENOMEM;
|
||||
if(!occopycat(path,pathlen,2,"./",*alias))
|
||||
return OC_EOVERRUN;
|
||||
if(!occopycat(path,pathlen,2,"./",*alias)) {
|
||||
if(path) free(path);
|
||||
return OC_EOVERRUN;
|
||||
}
|
||||
/* see if file is readable */
|
||||
f = fopen(path,"r");
|
||||
if(f != NULL) break;
|
||||
|
Loading…
Reference in New Issue
Block a user