From d4df0d40dc37b20d8ad486dbaa264106ac53fbb8 Mon Sep 17 00:00:00 2001 From: HDF Rational Date: Fri, 5 Oct 2001 17:29:20 -0500 Subject: [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) --- test/tgenprop.c | 13 +++++++++++-- 1 file 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); -- cgit v0.12