inflate: avoid a leak on a error path
authorJim Meyering <meyering@redhat.com>
Sun, 16 Aug 2009 19:58:48 +0000 (21:58 +0200)
committerJim Meyering <meyering@redhat.com>
Tue, 18 Aug 2009 07:28:06 +0000 (09:28 +0200)
* inflate.c (inflate_dynamic): Don't leak

inflate.c

index 2f8670d82c2c0f8eecd7d83fb2bfef092cefa04f..71ce8efdbcd764c4e752c9c9589f0be78ccb45a4 100644 (file)
--- 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;
+  }
 }