mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-12-09 07:32:32 +08:00
Merge pull request #1588 in HDFFV/hdf5 from ~SONGYULU/hdf5_ray:HDFFV-10705-memory-leak-in-scale-offset to develop
* commit 'b23079de3af4bfb7aa0508fb81aacd67a76c2114': HDFFV-10705: Fixed memory leak in scale offset filter.
This commit is contained in:
commit
5182e73d5e
@ -1174,6 +1174,8 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value
|
|||||||
/* special case: minbits equal to full precision */
|
/* special case: minbits equal to full precision */
|
||||||
if(minbits == p.size * 8) {
|
if(minbits == p.size * 8) {
|
||||||
HDmemcpy(outbuf, (unsigned char*)(*buf)+buf_offset, size_out);
|
HDmemcpy(outbuf, (unsigned char*)(*buf)+buf_offset, size_out);
|
||||||
|
/* free the original buffer */
|
||||||
|
H5MM_xfree(*buf);
|
||||||
|
|
||||||
/* convert to dataset datatype endianness order if needed */
|
/* convert to dataset datatype endianness order if needed */
|
||||||
if(need_convert)
|
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 */
|
/* special case: minbits equal to full precision */
|
||||||
if(minbits == p.size * 8) {
|
if(minbits == p.size * 8) {
|
||||||
HDmemcpy(outbuf + buf_offset, *buf, nbytes);
|
HDmemcpy(outbuf + buf_offset, *buf, nbytes);
|
||||||
|
/* free the original buffer */
|
||||||
|
H5MM_xfree(*buf);
|
||||||
|
|
||||||
*buf = outbuf;
|
*buf = outbuf;
|
||||||
outbuf = NULL;
|
outbuf = NULL;
|
||||||
*buf_size = size_out;
|
*buf_size = size_out;
|
||||||
|
Loading…
Reference in New Issue
Block a user