diff options
Diffstat (limited to 'src/common/unzip.c')
-rw-r--r-- | src/common/unzip.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/common/unzip.c b/src/common/unzip.c index 6d2315f..553ae6a 100644 --- a/src/common/unzip.c +++ b/src/common/unzip.c | |||
@@ -89,9 +89,6 @@ typedef struct unz_global_info_s | |||
89 | #ifndef ALLOC | 89 | #ifndef ALLOC |
90 | # define ALLOC(size) (malloc(size)) | 90 | # define ALLOC(size) (malloc(size)) |
91 | #endif | 91 | #endif |
92 | #ifndef TRYFREE | ||
93 | # define TRYFREE(p) {if (p) free(p);} | ||
94 | #endif | ||
95 | 92 | ||
96 | #define SIZECENTRALDIRITEM (0x2e) | 93 | #define SIZECENTRALDIRITEM (0x2e) |
97 | #define SIZEZIPLOCALHEADER (0x1e) | 94 | #define SIZEZIPLOCALHEADER (0x1e) |
@@ -356,7 +353,7 @@ unzlocal_SearchCentralDir(const EXTRACTOR_unzip_filefunc_def* pzlib_filefunc_def | |||
356 | if (uPosFound!=0) | 353 | if (uPosFound!=0) |
357 | break; | 354 | break; |
358 | } | 355 | } |
359 | TRYFREE(buf); | 356 | free(buf); |
360 | return uPosFound; | 357 | return uPosFound; |
361 | } | 358 | } |
362 | 359 | ||
@@ -695,13 +692,14 @@ EXTRACTOR_common_unzip_close_current_file (EXTRACTOR_unzip_file file) | |||
695 | } | 692 | } |
696 | 693 | ||
697 | 694 | ||
698 | TRYFREE(pfile_in_zip_read_info->read_buffer); | 695 | if (NULL != pfile_in_zip_read_info->read_buffer) |
696 | free(pfile_in_zip_read_info->read_buffer); | ||
699 | pfile_in_zip_read_info->read_buffer = NULL; | 697 | pfile_in_zip_read_info->read_buffer = NULL; |
700 | if (pfile_in_zip_read_info->stream_initialised) | 698 | if (pfile_in_zip_read_info->stream_initialised) |
701 | inflateEnd(&pfile_in_zip_read_info->stream); | 699 | inflateEnd(&pfile_in_zip_read_info->stream); |
702 | 700 | ||
703 | pfile_in_zip_read_info->stream_initialised = 0; | 701 | pfile_in_zip_read_info->stream_initialised = 0; |
704 | TRYFREE(pfile_in_zip_read_info); | 702 | free(pfile_in_zip_read_info); |
705 | 703 | ||
706 | s->pfile_in_zip_read=NULL; | 704 | s->pfile_in_zip_read=NULL; |
707 | 705 | ||
@@ -724,7 +722,7 @@ int EXTRACTOR_common_unzip_close (EXTRACTOR_unzip_file file) | |||
724 | EXTRACTOR_common_unzip_close_current_file(file); | 722 | EXTRACTOR_common_unzip_close_current_file(file); |
725 | 723 | ||
726 | ZCLOSE(s->z_filefunc, s->filestream); | 724 | ZCLOSE(s->z_filefunc, s->filestream); |
727 | TRYFREE(s); | 725 | free(s); |
728 | return EXTRACTOR_UNZIP_OK; | 726 | return EXTRACTOR_UNZIP_OK; |
729 | } | 727 | } |
730 | 728 | ||
@@ -1127,10 +1125,10 @@ EXTRACTOR_common_unzip_open_current_file3 (EXTRACTOR_unzip_file file, | |||
1127 | pfile_in_zip_read_info->raw=raw; | 1125 | pfile_in_zip_read_info->raw=raw; |
1128 | 1126 | ||
1129 | if (pfile_in_zip_read_info->read_buffer==NULL) | 1127 | if (pfile_in_zip_read_info->read_buffer==NULL) |
1130 | { | 1128 | { |
1131 | TRYFREE(pfile_in_zip_read_info); | 1129 | free(pfile_in_zip_read_info); |
1132 | return EXTRACTOR_UNZIP_INTERNALERROR; | 1130 | return EXTRACTOR_UNZIP_INTERNALERROR; |
1133 | } | 1131 | } |
1134 | 1132 | ||
1135 | pfile_in_zip_read_info->stream_initialised=0; | 1133 | pfile_in_zip_read_info->stream_initialised=0; |
1136 | 1134 | ||