From 17e347c6a762642682947ae92494fa89328001fb Mon Sep 17 00:00:00 2001 From: Qianqian Fang Date: Sun, 18 Aug 2024 17:12:13 -0400 Subject: [PATCH] [bug] fix lzma memory leakage, NeuroJSON/zmat#11, lloyd/easylzma#4 --- src/zmat/zmatlib.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/zmat/zmatlib.c b/src/zmat/zmatlib.c index 05d60db8..70be5121 100644 --- a/src/zmat/zmatlib.c +++ b/src/zmat/zmatlib.c @@ -965,6 +965,8 @@ simpleCompress(elzma_file_format format, const unsigned char* inData, *outLen = ds.outLen; } + elzma_compress_free(&hand); + return rc; } @@ -1009,6 +1011,8 @@ simpleDecompress(elzma_file_format format, const unsigned char* inData, return rc; } + elzma_decompress_free(&hand); + *outData = ds.outData; *outLen = ds.outLen; }