summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRay Lu <songyulu@hdfgroup.org>2019-03-08 16:46:12 (GMT)
committerRay Lu <songyulu@hdfgroup.org>2019-03-08 16:46:12 (GMT)
commit285bb9713cd9c18ad15cd851af90ff55746bfdaf (patch)
treeead00a122d98351fc53091c8c34b1574729da287
parent970dccd54b8a7b5e3d06013d45ede91de78e64ea (diff)
parent2f3c34c649b8ec04d399296fa6203f68615e55a0 (diff)
downloadhdf5-285bb9713cd9c18ad15cd851af90ff55746bfdaf.zip
hdf5-285bb9713cd9c18ad15cd851af90ff55746bfdaf.tar.gz
hdf5-285bb9713cd9c18ad15cd851af90ff55746bfdaf.tar.bz2
Merge pull request #1591 in HDFFV/hdf5 from ~SONGYULU/hdf5_ray:HDFFV-10705-for-1-10-branch to hdf5_1_10
* commit '2f3c34c649b8ec04d399296fa6203f68615e55a0': Revised the entry of bug fix for HDFFV-10705. Minor change: revised the note from the previous commit about HDFFV-10705. HDFFV-10705: added a release note. HDFFV-10705: Fixed memory leak in scale offset filter.
-rw-r--r--release_docs/RELEASE.txt10
-rw-r--r--src/H5Zscaleoffset.c5
2 files changed, 15 insertions, 0 deletions
diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt
index baa0456..3b68ba0 100644
--- a/release_docs/RELEASE.txt
+++ b/release_docs/RELEASE.txt
@@ -327,6 +327,16 @@ Bug Fixes since HDF5-1.10.4 release
Library
-------
+ - Fixed memory leak in scale offset filter
+
+ In a special case where the MinBits is the same as the number of bits in
+ the datatype's precision, the filter's data buffer was not freed, causing
+ the memory usage to grow. In general the buffer was freed correctly. The
+ Minbits are the minimal number of bits to store the data values. Please
+ see the reference manual for H5Pset_scaleoffset for the detail.
+
+ (RL - 2019/3/4, HDFFV-10705)
+
- Fix hangs with collective metadata reads during chunked dataset I/O
In the parallel library, it was discovered that when a particular
diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c
index cdf31a4..0026749 100644
--- a/src/H5Zscaleoffset.c
+++ b/src/H5Zscaleoffset.c
@@ -1174,6 +1174,8 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value
/* special case: minbits equal to full precision */
if(minbits == p.size * 8) {
HDmemcpy(outbuf, (unsigned char*)(*buf)+buf_offset, size_out);
+ /* free the original buffer */
+ H5MM_xfree(*buf);
/* convert to dataset datatype endianness order if needed */
if(need_convert)
@@ -1272,6 +1274,9 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value
/* special case: minbits equal to full precision */
if(minbits == p.size * 8) {
HDmemcpy(outbuf + buf_offset, *buf, nbytes);
+ /* free the original buffer */
+ H5MM_xfree(*buf);
+
*buf = outbuf;
outbuf = NULL;
*buf_size = size_out;