mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-18 15:55:12 +08:00
Fix memory problem detected with MALLOC_CHECK_=2
This commit is contained in:
parent
39b6c1eb5c
commit
d27879027e
@ -1530,7 +1530,7 @@ do_ncdump_rec(int ncid, const char *path, fspec_t* specp)
|
||||
size_t len;
|
||||
char *locname; /* the group name */
|
||||
NC_CHECK( nc_inq_grpname_full(locid, &len, NULL) );
|
||||
locname = emalloc(len);
|
||||
locname = emalloc(len + 1);
|
||||
NC_CHECK( nc_inq_grpname_full(locid, &len, locname) );
|
||||
print_name (locname);
|
||||
if(strcmp("/", locname) != 0) { /* not the root group */
|
||||
|
Loading…
Reference in New Issue
Block a user