mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-30 16:10:44 +08:00
Merge branch 'ejh_enum_mem_fix' of https://github.com/NetCDF-World-Domination-Council/netcdf-c into more_ejh_pulls
This commit is contained in:
commit
a9dde277d7
@ -1239,10 +1239,13 @@ nc_close(int ncid)
|
||||
#endif
|
||||
{
|
||||
|
||||
stat = ncp->dispatch->close(ncid);
|
||||
stat = ncp->dispatch->close(ncid);
|
||||
/* Remove from the nc list */
|
||||
del_from_NCList(ncp);
|
||||
free_NC(ncp);
|
||||
if (!stat)
|
||||
{
|
||||
del_from_NCList(ncp);
|
||||
free_NC(ncp);
|
||||
}
|
||||
}
|
||||
return stat;
|
||||
}
|
||||
|
@ -2988,7 +2988,7 @@ close_netcdf4_file(NC_HDF5_FILE_INFO_T *h5, int abort)
|
||||
exit:
|
||||
/* Free the nc4_info struct; above code should have reclaimed
|
||||
everything else */
|
||||
if(h5 != NULL)
|
||||
if(!retval && h5 != NULL)
|
||||
free(h5);
|
||||
return retval;
|
||||
}
|
||||
|
@ -304,8 +304,13 @@ main(int argc, char **argv)
|
||||
/* Close the file. */
|
||||
if (nc_close(ncid) != NC_EINVAL) ERR;
|
||||
|
||||
unsigned char ubyte_value = 42;
|
||||
if (nc_redef(ncid)) ERR;
|
||||
if (nc_insert_enum(ncid, typeid, "name", &ubyte_value)) ERR;
|
||||
if (nc_close(ncid)) ERR;
|
||||
}
|
||||
|
||||
SUMMARIZE_ERR;
|
||||
FINAL_RESULTS;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user