diff options
author | Songyu Lu <songyulu@hdfgroup.org> | 2019-03-04 16:22:51 (GMT) |
---|---|---|
committer | Songyu Lu <songyulu@hdfgroup.org> | 2019-03-04 16:22:51 (GMT) |
commit | 8a864f91eba77c9ca24c7efc5d9b4477fd26c77c (patch) | |
tree | 7ad8fc3f5b346d6dae46fe5b8b0c9630a9126373 | |
parent | 970dccd54b8a7b5e3d06013d45ede91de78e64ea (diff) | |
download | hdf5-8a864f91eba77c9ca24c7efc5d9b4477fd26c77c.zip hdf5-8a864f91eba77c9ca24c7efc5d9b4477fd26c77c.tar.gz hdf5-8a864f91eba77c9ca24c7efc5d9b4477fd26c77c.tar.bz2 |
HDFFV-10705: Fixed memory leak in scale offset filter.
-rw-r--r-- | src/H5Zscaleoffset.c | 5 |
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; |