From 93febe672a943ed1cb4391fa451c3721e1498335 Mon Sep 17 00:00:00 2001 From: Glenn L McGrath Date: Wed, 11 Jul 2001 07:25:01 +0000 Subject: free coniditionally, just to make it play nice with dmalloc which is incompatable with standard free() --- archival/libunarchive/decompress_unzip.c | 8 ++++++-- archival/libunarchive/unzip.c | 8 ++++++-- libbb/unzip.c | 8 ++++++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/archival/libunarchive/decompress_unzip.c b/archival/libunarchive/decompress_unzip.c index b85eb9981..23bf6c73c 100644 --- a/archival/libunarchive/decompress_unzip.c +++ b/archival/libunarchive/decompress_unzip.c @@ -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); + } } diff --git a/archival/libunarchive/unzip.c b/archival/libunarchive/unzip.c index b85eb9981..23bf6c73c 100644 --- a/archival/libunarchive/unzip.c +++ b/archival/libunarchive/unzip.c @@ -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); + } } diff --git a/libbb/unzip.c b/libbb/unzip.c index b85eb9981..23bf6c73c 100644 --- a/libbb/unzip.c +++ b/libbb/unzip.c @@ -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); + } } -- cgit v1.2.3