diff --git a/src/compress.c b/src/compress.c index 78be112..947c0a9 100644 --- a/src/compress.c +++ b/src/compress.c @@ -66,6 +66,8 @@ elzma_compress_free(elzma_compress_handle * hand) (ISzAlloc *) &((*hand)->allocStruct), (ISzAlloc *) &((*hand)->allocStruct)); } + + free(*hand); } *hand = NULL; diff --git a/test/easylzma_test.c b/test/easylzma_test.c index 80691d9..22a3d22 100644 --- a/test/easylzma_test.c +++ b/test/easylzma_test.c @@ -161,6 +161,8 @@ static int roundTripTest(elzma_file_format format) free(decompressed); return 1; } + + free(decompressed); return ELZMA_E_OK; } diff --git a/test/simple.c b/test/simple.c index 09df38e..26a6394 100644 --- a/test/simple.c +++ b/test/simple.c @@ -102,7 +102,9 @@ simpleCompress(elzma_file_format format, const unsigned char * inData, *outData = ds.outData; *outLen = ds.outLen; } - + + elzma_compress_free(&hand); + return rc; } @@ -137,5 +139,7 @@ simpleDecompress(elzma_file_format format, const unsigned char * inData, *outLen = ds.outLen; } + elzma_decompress_free(&hand); + return rc; }