summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>1998-07-07 21:53:41 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>1998-07-07 21:53:41 (GMT)
commit5ab92f6c59b909c51225ff886f9b7a24fdd1dcf6 (patch)
tree61026df76fb8ac1c908b184eac67f155a26e7e95
parent1bdb53fb6a8aed417d6fdedb0f11b73d6afae5d5 (diff)
downloadhdf5-5ab92f6c59b909c51225ff886f9b7a24fdd1dcf6.zip
hdf5-5ab92f6c59b909c51225ff886f9b7a24fdd1dcf6.tar.gz
hdf5-5ab92f6c59b909c51225ff886f9b7a24fdd1dcf6.tar.bz2
[svn-r462] Plugged several memory leaks in the hyperslab selection iterators.
-rw-r--r--src/H5D.c34
1 files changed, 21 insertions, 13 deletions
diff --git a/src/H5D.c b/src/H5D.c
index f232785..ec18477 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -29,7 +29,9 @@ static char RcsId[] = "@(#)$Revision$";
#include <H5Pprivate.h> /* Property lists */
#include <H5Zprivate.h> /* Data compression */
+#ifdef QAK
int qak_debug=0;
+#endif /* QAK */
#define PABLO_MASK H5D_mask
@@ -1375,7 +1377,7 @@ printf("%s: check 2.0\n",FUNC);
}
if (FAIL == (sconv_func.binit)(&(dataset->layout), mem_space, &bkg_iter)) {
HGOTO_ERROR (H5E_DATASET, H5E_CANTINIT, FAIL,
- "unable to initialize memory selection information");
+ "unable to initialize background selection information");
}
#ifdef QAK
printf("%s: check 3.0, request_nelmts=%d\n",FUNC,(int)request_nelmts);
@@ -1517,13 +1519,16 @@ printf("%s: check 9.0\n",FUNC);
done:
if (src_id >= 0) H5I_dec_ref(src_id);
if (dst_id >= 0) H5I_dec_ref(dst_id);
- if (tconv_buf && NULL==xfer_parms->tconv_buf) {
- H5MM_xfree(tconv_buf);
- }
- if (bkg_buf && NULL==xfer_parms->bkg_buf) {
- H5MM_xfree (bkg_buf);
- }
- if (free_this_space) H5S_close (free_this_space);
+ if (tconv_buf && NULL==xfer_parms->tconv_buf)
+ H5MM_xfree(tconv_buf);
+ if (bkg_buf && NULL==xfer_parms->bkg_buf)
+ H5MM_xfree (bkg_buf);
+ if (free_this_space)
+ H5S_close (free_this_space);
+ /* Release selection iterators */
+ H5S_sel_iter_release(file_space,&file_iter);
+ H5S_sel_iter_release(mem_space,&mem_iter);
+ H5S_sel_iter_release(mem_space,&bkg_iter);
FUNC_LEAVE(ret_value);
}
@@ -1854,13 +1859,16 @@ printf("%s: check 6.0\n",FUNC);
done:
if (src_id >= 0) H5I_dec_ref(src_id);
if (dst_id >= 0) H5I_dec_ref(dst_id);
- if (tconv_buf && NULL==xfer_parms->tconv_buf) {
+ if (tconv_buf && NULL==xfer_parms->tconv_buf)
H5MM_xfree(tconv_buf);
- }
- if (bkg_buf && NULL==xfer_parms->bkg_buf) {
+ if (bkg_buf && NULL==xfer_parms->bkg_buf)
H5MM_xfree (bkg_buf);
- }
- if (free_this_space) H5S_close (free_this_space);
+ if (free_this_space)
+ H5S_close (free_this_space);
+ /* Release selection iterators */
+ H5S_sel_iter_release(file_space,&file_iter);
+ H5S_sel_iter_release(mem_space,&mem_iter);
+ H5S_sel_iter_release(mem_space,&bkg_iter);
FUNC_LEAVE(ret_value);
}