summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-05-20 05:49:31 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-05-20 05:49:31 (GMT)
commit71befdadcf5ae79650875a4e19b8cc5dc0aac468 (patch)
treea0f2d1a9e991df89e4fe988fea7fb6503af74bb8
parent0fcfcf0fa4c1fe58301f3fe42f9b887bddf79ed1 (diff)
downloadhdf5-71befdadcf5ae79650875a4e19b8cc5dc0aac468.zip
hdf5-71befdadcf5ae79650875a4e19b8cc5dc0aac468.tar.gz
hdf5-71befdadcf5ae79650875a4e19b8cc5dc0aac468.tar.bz2
[svn-r13774] Description:
Fix memory leak of attribute's group hier. path Reduce compiler warnings w/gcc 4.2 Tested on: FreeBSD/32 6.2 (duty)
-rw-r--r--src/H5A.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/H5A.c b/src/H5A.c
index 9584f0b..2894daf 100644
--- a/src/H5A.c
+++ b/src/H5A.c
@@ -589,12 +589,12 @@ H5A_open_common(const H5G_loc_t *loc, H5A_t *attr)
/* Clear object location */
if(H5O_loc_reset(&(attr->oloc)) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to reset location")
-
- /* Clear path name */
- if(H5G_name_reset(&(attr->path)) < 0)
- HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to reset path")
#endif /* H5_USING_PURIFY */
+ /* Free any previous group hier. path */
+ if(H5G_name_free(&(attr->path)) < 0)
+ HGOTO_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't release group hier. path")
+
/* Deep copy of the symbol table entry */
if(H5O_loc_copy(&(attr->oloc), loc->oloc, H5_COPY_DEEP) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to copy entry")
@@ -701,7 +701,7 @@ H5A_open_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr_na
H5A_t *attr = NULL; /* Attribute from object header */
H5A_t *ret_value; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5A_open_by_name)
+ FUNC_ENTER_NOAPI(H5A_open_by_name, NULL)
/* check args */
HDassert(loc);
@@ -894,9 +894,9 @@ done:
if(dst_id >= 0)
(void)H5I_dec_ref(dst_id);
if(tconv_buf && !tconv_owned)
- tconv_buf = H5FL_BLK_FREE(attr_buf, tconv_buf);
+ H5FL_BLK_FREE(attr_buf, tconv_buf);
if(bkg_buf)
- bkg_buf = H5FL_BLK_FREE(attr_buf, bkg_buf);
+ H5FL_BLK_FREE(attr_buf, bkg_buf);
FUNC_LEAVE_NOAPI(ret_value)
} /* H5A_write() */
@@ -1038,9 +1038,9 @@ done:
if(dst_id >= 0)
(void)H5I_dec_ref(dst_id);
if(tconv_buf)
- tconv_buf = H5FL_BLK_FREE(attr_buf, tconv_buf);
+ H5FL_BLK_FREE(attr_buf, tconv_buf);
if(bkg_buf)
- bkg_buf = H5FL_BLK_FREE(attr_buf, bkg_buf);
+ H5FL_BLK_FREE(attr_buf, bkg_buf);
FUNC_LEAVE_NOAPI(ret_value)
} /* H5A_read() */
@@ -2137,7 +2137,7 @@ H5A_close(H5A_t *attr)
HGOTO_ERROR(H5E_ATTR, H5E_WRITEERROR, FAIL, "unable to write attribute")
/* Free temporary buffer */
- tmp_buf = H5FL_BLK_FREE(attr_buf, tmp_buf);
+ H5FL_BLK_FREE(attr_buf, tmp_buf);
} /* end if */
/* Free dynamicly allocated items */