summaryrefslogtreecommitdiffstats
path: root/src/H5Gtraverse.c
diff options
context:
space:
mode:
authorElena Pourmal <epourmal@hdfgroup.org>2006-09-05 23:36:01 (GMT)
committerElena Pourmal <epourmal@hdfgroup.org>2006-09-05 23:36:01 (GMT)
commitd553c60eb0428adaa3b1d9c647a1b465b65b8408 (patch)
tree8ec4ab3b924f14a9f78f53402b7405976b055a80 /src/H5Gtraverse.c
parent46467e91b0c96f368b2ac75569dfab2d3a097ef8 (diff)
downloadhdf5-d553c60eb0428adaa3b1d9c647a1b465b65b8408.zip
hdf5-d553c60eb0428adaa3b1d9c647a1b465b65b8408.tar.gz
hdf5-d553c60eb0428adaa3b1d9c647a1b465b65b8408.tar.bz2
[svn-r12650] Description:
Purify found some memory leaks in the code related to the HDF5 external links. James provided the fix and asked me to check it in. Tested: heping, mir, shanti, and juniper
Diffstat (limited to 'src/H5Gtraverse.c')
-rw-r--r--src/H5Gtraverse.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/H5Gtraverse.c b/src/H5Gtraverse.c
index 4128604..acdd665 100644
--- a/src/H5Gtraverse.c
+++ b/src/H5Gtraverse.c
@@ -555,6 +555,8 @@ H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target,
/* Free information for link (but don't free link pointer) */
if(lnk.type == H5L_LINK_SOFT)
lnk.u.soft.name = H5MM_xfree(lnk.u.soft.name);
+ else if(lnk.type >= H5L_LINK_UD_MIN && lnk.u.ud.size > 0)
+ lnk.u.ud.udata = H5MM_xfree(lnk.u.ud.udata);
lnk.name = H5MM_xfree(lnk.name);
#endif /* H5_GROUP_REVISION */
link_valid = FALSE;
@@ -751,6 +753,8 @@ done:
/* Free information for link (but don't free link pointer) */
if(lnk.type == H5L_LINK_SOFT)
lnk.u.soft.name = H5MM_xfree(lnk.u.soft.name);
+ else if(lnk.type >= H5L_LINK_UD_MIN && lnk.u.ud.size > 0)
+ lnk.u.ud.udata = H5MM_xfree(lnk.u.ud.udata);
lnk.name = H5MM_xfree(lnk.name);
#endif /* H5_GROUP_REVISION */
} /* end if */