summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5tools.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lib/h5tools.c')
-rw-r--r--tools/lib/h5tools.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index 5c8631e..bf85bc2 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -2545,6 +2545,9 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info,
}
}
+ if(!sm_nbytes)
+ goto done;
+
assert(sm_nbytes == (hsize_t)((size_t)sm_nbytes)); /*check for overflow*/
sm_buf = (unsigned char *)HDmalloc((size_t)sm_nbytes);
@@ -2619,11 +2622,12 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info,
fputs(OPT(info->line_sep, ""), stream);
}
+ HDfree(sm_buf);
+
+done:
H5Sclose(sm_space);
H5Sclose(f_space);
- HDfree(sm_buf);
-
return SUCCEED;
}