diff options
author | HDF Rational <hdfrat@ncsa.uiuc.edu> | 2001-10-05 22:29:20 (GMT) |
---|---|---|
committer | HDF Rational <hdfrat@ncsa.uiuc.edu> | 2001-10-05 22:29:20 (GMT) |
commit | d4df0d40dc37b20d8ad486dbaa264106ac53fbb8 (patch) | |
tree | 4d8533955f3ca58f402a782cf6260aaad6bef25e /test | |
parent | 4b3875ad58a9329691acbff4e3193131d3b6f539 (diff) | |
download | hdf5-d4df0d40dc37b20d8ad486dbaa264106ac53fbb8.zip hdf5-d4df0d40dc37b20d8ad486dbaa264106ac53fbb8.tar.gz hdf5-d4df0d40dc37b20d8ad486dbaa264106ac53fbb8.tar.bz2 |
[svn-r4527] Purpose:
Code cleanup
Description:
Purify detected some resource leaks in the tests.
Solution:
Released memory and property lists properly.
Platforms tested:
Solaris 2.7 (arabica)
Diffstat (limited to 'test')
-rw-r--r-- | test/tgenprop.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/test/tgenprop.c b/test/tgenprop.c index ae906b2..c2e5c76 100644 --- a/test/tgenprop.c +++ b/test/tgenprop.c @@ -958,8 +958,10 @@ test_genprop_prop_cls_cb1(const char *name, size_t size, void *value) { /* Set the information from the close call */ prop1_cb_info.cls_count++; - prop1_cb_info.cls_name=HDstrdup(name); - prop1_cb_info.cls_value=HDmalloc(size); + if(prop1_cb_info.cls_name==NULL) + prop1_cb_info.cls_name=HDstrdup(name); + if(prop1_cb_info.cls_value==NULL) + prop1_cb_info.cls_value=HDmalloc(size); HDmemcpy(prop1_cb_info.cls_value,value,size); return(SUCCEED); @@ -1172,6 +1174,13 @@ test_genprop_list_callback(void) printf("Property #1 value doesn't match!, line=%d\n",__LINE__); } /* end if */ + /* Close second list */ + ret = H5Pclose_list(lid2); + CHECK_I(ret, "H5Pclose_list"); + + /* Verify close callback information for properties tracked */ + VERIFY(prop1_cb_info.cls_count, 2, "H5Pclose"); + /* Free memory allocated for tracking properties */ HDfree(prop1_cb_info.crt_name); HDfree(prop1_cb_info.crt_value); |