mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-11-21 03:13:42 +08:00
Removed a potential double-free identified by static analysis.
This commit is contained in:
parent
3e1bd3ce5f
commit
db8d23b986
@ -1203,7 +1203,10 @@ NC3_open(const char * path, int ioflags,
|
||||
* !_CRAYMPP, only pe 0 is valid
|
||||
*/
|
||||
if(basepe != 0) {
|
||||
if(nc3) free(nc3);
|
||||
if(nc3) {
|
||||
free(nc3);
|
||||
nc3 = NULL;
|
||||
}
|
||||
status = NC_EINVAL;
|
||||
goto unwind_alloc;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user