Removed a potential double-free identified by static analysis.

This commit is contained in:
Ward Fisher 2018-05-31 15:09:11 -06:00
parent 3e1bd3ce5f
commit db8d23b986

View File

@ -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;
}