From: Fabian Keil <fk@fabiankeil.de>
Date: Thu, 10 Sep 2020 16:22:13 +0000 (+0200)
Subject: decompress_iob(): Don't leak the memory allocated by inflateInit2()
X-Git-Tag: v_3_0_29~147
X-Git-Url: http://www.privoxy.org/gitweb/%22https:/@default-cgi@/faq/user-manual/@default-cgi@show-status?a=commitdiff_plain;h=bbd53f1010b3d6a7b55d0094b2370c3a49322ddb;p=privoxy.git

decompress_iob(): Don't leak the memory allocated by inflateInit2()

... when the buffer limit is reached or we're running out of memory.
---

diff --git a/parsers.c b/parsers.c
index ec3ad71e..48195f89 100644
--- a/parsers.c
+++ b/parsers.c
@@ -727,6 +727,7 @@ jb_err decompress_iob(struct client_state *csp)
       {
          log_error(LOG_LEVEL_ERROR, "Buffer limit reached while decompressing iob");
          freez(buf);
+         inflateEnd(&zstr);
          return JB_ERR_MEMORY;
       }
 
@@ -745,6 +746,7 @@ jb_err decompress_iob(struct client_state *csp)
       {
          log_error(LOG_LEVEL_ERROR, "Out of memory decompressing iob");
          freez(buf);
+         inflateEnd(&zstr);
          return JB_ERR_MEMORY;
       }
       else