Remove TRYFREE macro from minizip.
This commit is contained in:
parent
c97a8f1e67
commit
384e50eea4
@ -111,9 +111,6 @@
|
||||
#ifndef ALLOC
|
||||
# define ALLOC(size) (malloc(size))
|
||||
#endif
|
||||
#ifndef TRYFREE
|
||||
# define TRYFREE(p) { free(p);}
|
||||
#endif
|
||||
|
||||
#define SIZECENTRALDIRITEM (0x2e)
|
||||
#define SIZEZIPLOCALHEADER (0x1e)
|
||||
@ -380,7 +377,7 @@ local ZPOS64_T unz64local_SearchCentralDir(const zlib_filefunc64_32_def* pzlib_f
|
||||
if (uPosFound!=CENTRALDIRINVALID)
|
||||
break;
|
||||
}
|
||||
TRYFREE(buf);
|
||||
free(buf);
|
||||
return uPosFound;
|
||||
}
|
||||
|
||||
@ -443,7 +440,7 @@ local ZPOS64_T unz64local_SearchCentralDir64(const zlib_filefunc64_32_def* pzlib
|
||||
if (uPosFound!=CENTRALDIRINVALID)
|
||||
break;
|
||||
}
|
||||
TRYFREE(buf);
|
||||
free(buf);
|
||||
if (uPosFound == CENTRALDIRINVALID)
|
||||
return CENTRALDIRINVALID;
|
||||
|
||||
@ -723,7 +720,7 @@ extern int ZEXPORT unzClose(unzFile file) {
|
||||
unzCloseCurrentFile(file);
|
||||
|
||||
ZCLOSE64(s->z_filefunc, s->filestream);
|
||||
TRYFREE(s);
|
||||
free(s);
|
||||
return UNZ_OK;
|
||||
}
|
||||
|
||||
@ -1384,7 +1381,7 @@ extern int ZEXPORT unzOpenCurrentFile3(unzFile file, int* method,
|
||||
|
||||
if (pfile_in_zip_read_info->read_buffer==NULL)
|
||||
{
|
||||
TRYFREE(pfile_in_zip_read_info);
|
||||
free(pfile_in_zip_read_info);
|
||||
return UNZ_INTERNALERROR;
|
||||
}
|
||||
|
||||
@ -1441,8 +1438,8 @@ extern int ZEXPORT unzOpenCurrentFile3(unzFile file, int* method,
|
||||
pfile_in_zip_read_info->stream_initialised=Z_BZIP2ED;
|
||||
else
|
||||
{
|
||||
TRYFREE(pfile_in_zip_read_info->read_buffer);
|
||||
TRYFREE(pfile_in_zip_read_info);
|
||||
free(pfile_in_zip_read_info->read_buffer);
|
||||
free(pfile_in_zip_read_info);
|
||||
return err;
|
||||
}
|
||||
#else
|
||||
@ -1462,8 +1459,8 @@ extern int ZEXPORT unzOpenCurrentFile3(unzFile file, int* method,
|
||||
pfile_in_zip_read_info->stream_initialised=Z_DEFLATED;
|
||||
else
|
||||
{
|
||||
TRYFREE(pfile_in_zip_read_info->read_buffer);
|
||||
TRYFREE(pfile_in_zip_read_info);
|
||||
free(pfile_in_zip_read_info->read_buffer);
|
||||
free(pfile_in_zip_read_info);
|
||||
return err;
|
||||
}
|
||||
/* windowBits is passed < 0 to tell that there is no zlib header.
|
||||
@ -1894,7 +1891,7 @@ extern int ZEXPORT unzCloseCurrentFile(unzFile file) {
|
||||
}
|
||||
|
||||
|
||||
TRYFREE(pfile_in_zip_read_info->read_buffer);
|
||||
free(pfile_in_zip_read_info->read_buffer);
|
||||
pfile_in_zip_read_info->read_buffer = NULL;
|
||||
if (pfile_in_zip_read_info->stream_initialised == Z_DEFLATED)
|
||||
inflateEnd(&pfile_in_zip_read_info->stream);
|
||||
@ -1905,7 +1902,7 @@ extern int ZEXPORT unzCloseCurrentFile(unzFile file) {
|
||||
|
||||
|
||||
pfile_in_zip_read_info->stream_initialised = 0;
|
||||
TRYFREE(pfile_in_zip_read_info);
|
||||
free(pfile_in_zip_read_info);
|
||||
|
||||
s->pfile_in_zip_read=NULL;
|
||||
|
||||
|
@ -62,9 +62,6 @@
|
||||
#ifndef ALLOC
|
||||
# define ALLOC(size) (malloc(size))
|
||||
#endif
|
||||
#ifndef TRYFREE
|
||||
# define TRYFREE(p) {if (p) free(p);}
|
||||
#endif
|
||||
|
||||
/*
|
||||
#define SIZECENTRALDIRITEM (0x2e)
|
||||
@ -204,7 +201,7 @@ local void free_datablock(linkedlist_datablock_internal* ldi) {
|
||||
while (ldi!=NULL)
|
||||
{
|
||||
linkedlist_datablock_internal* ldinext = ldi->next_datablock;
|
||||
TRYFREE(ldi);
|
||||
free(ldi);
|
||||
ldi = ldinext;
|
||||
}
|
||||
}
|
||||
@ -505,7 +502,7 @@ local ZPOS64_T zip64local_SearchCentralDir(const zlib_filefunc64_32_def* pzlib_f
|
||||
if (uPosFound!=0)
|
||||
break;
|
||||
}
|
||||
TRYFREE(buf);
|
||||
free(buf);
|
||||
return uPosFound;
|
||||
}
|
||||
|
||||
@ -568,7 +565,7 @@ local ZPOS64_T zip64local_SearchCentralDir64(const zlib_filefunc64_32_def* pzlib
|
||||
break;
|
||||
}
|
||||
|
||||
TRYFREE(buf);
|
||||
free(buf);
|
||||
if (uPosFound == 0)
|
||||
return 0;
|
||||
|
||||
@ -802,7 +799,7 @@ local int LoadCentralDirectoryRecord(zip64_internal* pziinit) {
|
||||
|
||||
size_central_dir_to_read-=read_this;
|
||||
}
|
||||
TRYFREE(buf_read);
|
||||
free(buf_read);
|
||||
}
|
||||
pziinit->begin_pos = byte_before_the_zipfile;
|
||||
pziinit->number_entry = number_entry_CD;
|
||||
@ -876,9 +873,9 @@ extern zipFile ZEXPORT zipOpen3(const void *pathname, int append, zipcharpc* glo
|
||||
if (err != ZIP_OK)
|
||||
{
|
||||
# ifndef NO_ADDFILEINEXISTINGZIP
|
||||
TRYFREE(ziinit.globalcomment);
|
||||
free(ziinit.globalcomment);
|
||||
# endif /* !NO_ADDFILEINEXISTINGZIP*/
|
||||
TRYFREE(zi);
|
||||
free(zi);
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
@ -1885,9 +1882,9 @@ extern int ZEXPORT zipClose(zipFile file, const char* global_comment) {
|
||||
err = ZIP_ERRNO;
|
||||
|
||||
#ifndef NO_ADDFILEINEXISTINGZIP
|
||||
TRYFREE(zi->globalcomment);
|
||||
free(zi->globalcomment);
|
||||
#endif
|
||||
TRYFREE(zi);
|
||||
free(zi);
|
||||
|
||||
return err;
|
||||
}
|
||||
@ -1944,7 +1941,7 @@ extern int ZEXPORT zipRemoveExtraInfoBlock(char* pData, int* dataLen, short sHea
|
||||
else
|
||||
retVal = ZIP_ERRNO;
|
||||
|
||||
TRYFREE(pNewHeader);
|
||||
free(pNewHeader);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user