From a318ac2f8398517912e6fd8bd5a3869c1aca5552 Mon Sep 17 00:00:00 2001 From: Francois Berder <18538310+francois-berder@users.noreply.github.com> Date: Wed, 28 Aug 2019 09:40:49 +0100 Subject: [PATCH] Fix memory leak in comparestream_open Signed-off-by: Francois Berder <18538310+francois-berder@users.noreply.github.com> --- src/lzsa.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lzsa.c b/src/lzsa.c index 4136d7d..939a2c9 100755 --- a/src/lzsa.c +++ b/src/lzsa.c @@ -277,8 +277,10 @@ int comparestream_open(lzsa_stream_t *stream, const char *pszCompareFilename, co stream->close = comparestream_close; return 0; } - else + else { + free(pCompareStream); return -1; + } } static int do_compare(const char *pszInFilename, const char *pszOutFilename, const char *pszDictionaryFilename, const unsigned int nOptions, int nFormatVersion) {