summaryrefslogtreecommitdiffstats
path: root/src/H5Zscaleoffset.c
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 /src/H5Zscaleoffset.c
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.
Diffstat (limited to 'src/H5Zscaleoffset.c')
-rw-r--r--src/H5Zscaleoffset.c5
1 files changed, 5 insertions, 0 deletions
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;