From 61b7b58dcb8f49ece6c3e4c1025464aec1035e0c Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Wed, 19 Apr 2017 08:07:11 +1000 Subject: zlib: deflate: free correct pointer on error Reported-by: Stuart Cassoff Signed-off-by: Steve Bennett --- jim-zlib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jim-zlib.c b/jim-zlib.c index cbbc291..36bb02f 100644 --- a/jim-zlib.c +++ b/jim-zlib.c @@ -98,7 +98,7 @@ static int Jim_Compress(Jim_Interp *interp, const char *in, int len, long level, * decompressed data anyway, so there's no reason to do chunked * decompression */ if (deflate(&strm, Z_FINISH) != Z_STREAM_END) { - Jim_Free(strm.next_out); + Jim_Free(buf); deflateEnd(&strm); return JIM_ERR; } @@ -106,7 +106,7 @@ static int Jim_Compress(Jim_Interp *interp, const char *in, int len, long level, deflateEnd(&strm); if (strm.total_out > INT_MAX) { - Jim_Free(strm.next_out); + Jim_Free(buf); return JIM_ERR; } -- cgit v1.1