Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion contrib/minizip/mztools.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ extern int ZEXPORT unzRepair(const char* file, const char* fileOut, const char*
FILE* fpZip = fopen(file, "rb");
FILE* fpOut = fopen(fileOut, "wb");
FILE* fpOutCD = fopen(fileOutTmp, "wb");
if (fpZip != NULL && fpOut != NULL) {
if (fpZip != NULL && fpOut != NULL && fpOutCD != NULL ) {
int entries = 0;
uLong totalBytes = 0;
char header[30];
Expand Down Expand Up @@ -282,6 +282,12 @@ extern int ZEXPORT unzRepair(const char* file, const char* fileOut, const char*
}
}
} else {
if (fpOutCD != NULL)
fclose(fpOutCD);
if (fpZip != NULL)
fclose(fpZip);
if (fpOut != NULL)
fclose(fpOut);
err = Z_STREAM_ERROR;
}
return err;
Expand Down