diff options
-rw-r--r-- | release_docs/RELEASE.txt | 10 | ||||
-rw-r--r-- | src/H5Zscaleoffset.c | 5 |
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; |