summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2017-10-23 17:41:17 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2017-10-23 17:41:17 (GMT)
commit7dbf569af90f098a702da84f439c85acb92635df (patch)
tree0309cfca5c360aca7c1df2b35d5a8df1b86eb900 /tools
parent118326833483e67a5b87f86e44b7bc2040188ac1 (diff)
downloadhdf5-7dbf569af90f098a702da84f439c85acb92635df.zip
hdf5-7dbf569af90f098a702da84f439c85acb92635df.tar.gz
hdf5-7dbf569af90f098a702da84f439c85acb92635df.tar.bz2
HDFFV-10297 Free buffer used in loop
Diffstat (limited to 'tools')
-rw-r--r--tools/h5repack/h5repack_copy.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c
index 86fa91d..772a9fe 100644
--- a/tools/h5repack/h5repack_copy.c
+++ b/tools/h5repack/h5repack_copy.c
@@ -877,7 +877,12 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
if (TRUE == H5Tdetect_class(wtype_id, H5T_VLEN))
if (H5Dvlen_reclaim(wtype_id, f_space_id, H5P_DEFAULT, buf) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dvlen_reclaim failed");
- }
+ /* free */
+ if (buf != NULL) {
+ HDfree(buf);
+ buf = NULL;
+ }
+ }
else { /* possibly not enough memory, read/write by hyperslabs */
size_t p_type_nbytes = msize; /*size of memory type */
hsize_t p_nelmts = nelmts; /*total elements */