From a84a510b3a4fa2f439ab53e964e067d28cef7257 Mon Sep 17 00:00:00 2001 From: Joe Mistachkin Date: Thu, 11 Jun 2015 02:47:41 +0000 Subject: Plug memory leaks in the Tcl_ZlibInflate() error handling code. Fix for ticket [478c446889]. --- generic/tclZlib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/generic/tclZlib.c b/generic/tclZlib.c index 956e3f9..c5ccc72 100644 --- a/generic/tclZlib.c +++ b/generic/tclZlib.c @@ -1757,6 +1757,7 @@ Tcl_ZlibInflate( if (headerPtr) { e = inflateGetHeader(&stream, headerPtr); if (e != Z_OK) { + inflateEnd(&stream); goto error; } } @@ -1780,7 +1781,7 @@ Tcl_ZlibInflate( if ((stream.avail_in == 0) && (stream.avail_out > 0)) { e = Z_STREAM_ERROR; - goto error; + break; } newBufferSize = bufferSize + 5 * stream.avail_in; if (newBufferSize == bufferSize) { -- cgit v0.12