free coniditionally, just to make it play nice with dmalloc which is incompatable with standard free()

This commit is contained in:
Glenn L McGrath 2001-07-11 07:25:01 +00:00
parent c59fa37d40
commit 93febe672a
3 changed files with 18 additions and 6 deletions

View File

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

View File

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

View File

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