aboutsummaryrefslogtreecommitdiff
path: root/jim-zlib.c
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2017-04-19 08:07:11 +1000
committerSteve Bennett <steveb@workware.net.au>2017-04-19 08:07:11 +1000
commit61b7b58dcb8f49ece6c3e4c1025464aec1035e0c (patch)
tree5aa1ca7e78bb6feca42765f6929be83afe2ea721 /jim-zlib.c
parentf69586f06d7d819fecd217295c4ef541db8cc181 (diff)
downloadjimtcl-61b7b58dcb8f49ece6c3e4c1025464aec1035e0c.zip
jimtcl-61b7b58dcb8f49ece6c3e4c1025464aec1035e0c.tar.gz
jimtcl-61b7b58dcb8f49ece6c3e4c1025464aec1035e0c.tar.bz2
zlib: deflate: free correct pointer on error
Reported-by: Stuart Cassoff <stwo@bell.net> Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jim-zlib.c')
-rw-r--r--jim-zlib.c4
1 files 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;
}