From 50d2020a785cd5afa844d52848613ffc011df00a Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 16 Aug 2009 21:58:48 +0200 Subject: [PATCH] inflate: avoid a leak on a error path * inflate.c (inflate_dynamic): Don't leak --- inflate.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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; + } } -- 2.47.2