summaryrefslogtreecommitdiffstats
path: root/tools/h5repack/h5repack_refs.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/h5repack/h5repack_refs.c')
-rw-r--r--tools/h5repack/h5repack_refs.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/h5repack/h5repack_refs.c b/tools/h5repack/h5repack_refs.c
index f4aa8ff..5690091 100644
--- a/tools/h5repack/h5repack_refs.c
+++ b/tools/h5repack/h5repack_refs.c
@@ -533,6 +533,23 @@ static int copy_refs_attr(hid_t loc_in,
}
H5Tclose(mtid);
}
+
+ /* if don't contain reference type, free malloc for continue
+ * and malloc again later */
+ if (!ref_comp_field_n)
+ {
+ if (ref_comp_index)
+ {
+ HDfree(ref_comp_index);
+ ref_comp_index = NULL;
+ }
+
+ if (ref_comp_size)
+ {
+ HDfree(ref_comp_size);
+ ref_comp_size = NULL;
+ }
+ }
}
is_ref_comp = (ref_comp_field_n > 0);