free coniditionally, just to make it play nice with dmalloc which is incompatable...
authorGlenn L McGrath <bug1@ihug.co.nz>
Wed, 11 Jul 2001 07:25:01 +0000 (07:25 -0000)
committerGlenn L McGrath <bug1@ihug.co.nz>
Wed, 11 Jul 2001 07:25:01 +0000 (07:25 -0000)
archival/libunarchive/decompress_unzip.c
archival/libunarchive/unzip.c
libbb/unzip.c

index b85eb9981c5cab8ee50f2052a4482c7f13a0e17f..23bf6c73c0b1f420d872bf89571007ee103aae23 100644 (file)
@@ -1024,6 +1024,10 @@ extern void gz_close(int gunzip_pid)
        if (waitpid(gunzip_pid, NULL, 0) == -1) {
                printf("Couldnt wait ?");
        }
-       free(window);
-       free(crc_table);
+       if (window) {
+               free(window);
+       }
+       if (crc_table) {
+               free(crc_table);
+       }
 }
index b85eb9981c5cab8ee50f2052a4482c7f13a0e17f..23bf6c73c0b1f420d872bf89571007ee103aae23 100644 (file)
@@ -1024,6 +1024,10 @@ extern void gz_close(int gunzip_pid)
        if (waitpid(gunzip_pid, NULL, 0) == -1) {
                printf("Couldnt wait ?");
        }
-       free(window);
-       free(crc_table);
+       if (window) {
+               free(window);
+       }
+       if (crc_table) {
+               free(crc_table);
+       }
 }
index b85eb9981c5cab8ee50f2052a4482c7f13a0e17f..23bf6c73c0b1f420d872bf89571007ee103aae23 100644 (file)
@@ -1024,6 +1024,10 @@ extern void gz_close(int gunzip_pid)
        if (waitpid(gunzip_pid, NULL, 0) == -1) {
                printf("Couldnt wait ?");
        }
-       free(window);
-       free(crc_table);
+       if (window) {
+               free(window);
+       }
+       if (crc_table) {
+               free(crc_table);
+       }
 }