Free memory in error paths.
authorgraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Sun, 15 Nov 2009 09:28:48 +0000 (09:28 +0000)
committergraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Sun, 15 Nov 2009 09:28:48 +0000 (09:28 +0000)
git-svn-id: http://opkg.googlecode.com/svn/trunk@308 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

libbb/unzip.c

index 88d2a0a..058aa07 100644 (file)
@@ -639,8 +639,11 @@ static int inflate_block(int *e)
                        }
 
                        /* decompress until an end-of-block code */
-                       if (inflate_codes(tl, td, bl, bd))
+                       if (inflate_codes(tl, td, bl, bd)) {
+                               huft_free(tl);
+                               huft_free(td);
                                return 1;
+                       }
 
                        /* free the decoding tables, return */
                        huft_free(tl);
@@ -816,8 +819,11 @@ static int inflate_block(int *e)
                        }
 
                        /* decompress until an end-of-block code */
-                       if (inflate_codes(tl, td, bl, bd))
+                       if (inflate_codes(tl, td, bl, bd)) {
+                               huft_free(tl);
+                               huft_free(td);
                                return 1;
+                       }
 
                        /* free the decoding tables, return */
                        huft_free(tl);