summaryrefslogtreecommitdiffstats
path: root/src/H5Pint.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2012-05-18 14:08:58 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2012-05-18 14:08:58 (GMT)
commit7aaa1ad2297b8e109cbff503be0cc4e73ada0871 (patch)
tree24b893eec0e27f39b80da51de493d4f241a8bd06 /src/H5Pint.c
parent27535adaa934d4e2d0384428a72645c102dd88fa (diff)
downloadhdf5-7aaa1ad2297b8e109cbff503be0cc4e73ada0871.zip
hdf5-7aaa1ad2297b8e109cbff503be0cc4e73ada0871.tar.gz
hdf5-7aaa1ad2297b8e109cbff503be0cc4e73ada0871.tar.bz2
[svn-r22375] add a test to expose a memory leak when adding/removing the same property in property list multiple times.
fix that bug. test with h5committest
Diffstat (limited to 'src/H5Pint.c')
-rw-r--r--src/H5Pint.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/H5Pint.c b/src/H5Pint.c
index 46a06a0..b216ab3 100644
--- a/src/H5Pint.c
+++ b/src/H5Pint.c
@@ -2314,9 +2314,13 @@ H5P_insert(H5P_genplist_t *plist, const char *name, size_t size,
/* Check if the property has been deleted */
if(NULL != H5SL_search(plist->del, name)) {
+ char *temp_name = NULL;
/* Remove the property name from the deleted property skip list */
- if(NULL == H5SL_remove(plist->del, name))
+ if(NULL == (temp_name = H5SL_remove(plist->del, name)))
HGOTO_ERROR(H5E_PLIST,H5E_CANTDELETE,FAIL,"can't remove property from deleted skip list")
+
+ /* free the name of the removed property */
+ H5MM_xfree(temp_name);
} /* end if */
else {
H5P_genclass_t *tclass; /* Temporary class pointer */