opkg: fix some initialisation and double free issues in libbb
[oweals/opkg-lede.git] / libbb / unzip.c
index 3826316bb168a0e1b51dd2f775ca9834f4c63c42..fb2429bf058a560eb724099272782854871da215 100644 (file)
@@ -71,7 +71,7 @@ static FILE *in_file, *out_file;
 
 /* these are freed by gz_close */
 static unsigned char *window;
-static unsigned long *crc_table;
+static unsigned long *crc_table = NULL;
 
 static unsigned long crc; /* shift register contents */
 
@@ -1020,6 +1020,9 @@ extern int unzip(FILE *l_in_file, FILE *l_out_file)
        free(window);
        free(crc_table);
 
+       window = NULL;
+       crc_table = NULL;
+
        return exit_code;
 }