diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2012-05-18 14:08:58 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2012-05-18 14:08:58 (GMT) |
commit | 7aaa1ad2297b8e109cbff503be0cc4e73ada0871 (patch) | |
tree | 24b893eec0e27f39b80da51de493d4f241a8bd06 /src | |
parent | 27535adaa934d4e2d0384428a72645c102dd88fa (diff) | |
download | hdf5-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')
-rw-r--r-- | src/H5Pint.c | 6 |
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 */ |