From: Jim Meyering Date: Sun, 16 Aug 2009 19:58:48 +0000 (+0200) Subject: inflate: avoid a leak on a error path X-Git-Tag: v1.3.13~22 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=50d2020a785cd5afa844d52848613ffc011df00a;p=debian%2Fgzip inflate: avoid a leak on a error path * inflate.c (inflate_dynamic): Don't leak --- diff --git a/inflate.c b/inflate.c index 2f8670d..71ce8ef 100644 --- a/inflate.c +++ b/inflate.c @@ -887,15 +887,16 @@ int inflate_dynamic() } - /* decompress until an end-of-block code */ - if (inflate_codes(tl, td, bl, bd)) - return 1; + { + /* decompress until an end-of-block code */ + int err = inflate_codes(tl, td, bl, bd) ? 1 : 0; + /* free the decoding tables */ + huft_free(tl); + huft_free(td); - /* free the decoding tables, return */ - huft_free(tl); - huft_free(td); - return 0; + return err; + } }