summaryrefslogtreecommitdiffstats
path: root/src/H5Pint.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2012-05-18 14:18:09 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2012-05-18 14:18:09 (GMT)
commitca8d4218d2a7b888e04bd40c22cc090fb7cd207d (patch)
tree8e6745ee54ca040f8d14ffa530a5078e41d64037 /src/H5Pint.c
parentc11b378c891d0f1209ad5af499ecd94466868528 (diff)
downloadhdf5-ca8d4218d2a7b888e04bd40c22cc090fb7cd207d.zip
hdf5-ca8d4218d2a7b888e04bd40c22cc090fb7cd207d.tar.gz
hdf5-ca8d4218d2a7b888e04bd40c22cc090fb7cd207d.tar.bz2
[svn-r22376] add a test to expose a memory leak when adding/removing the same property in property list multiple times.
fix that bug.
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 */