From 8444379d5357ebed6bb30aca0cb2e804128f399a Mon Sep 17 00:00:00 2001 From: Sryder13 Date: Sat, 22 Jun 2019 00:52:28 +0100 Subject: [PATCH] Free the zentries --- src/w_wad.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/w_wad.c b/src/w_wad.c index 6ed2d50c..8d96449f 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -565,14 +565,14 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp) { CONS_Alert(CONS_ERROR, "Failed to read central directory (%s)\n", strerror(ferror(handle))); Z_Free(lumpinfo); - free(zentry); + free(zentries); return NULL; } if (memcmp(zentry->signature, pat_central, 4)) { CONS_Alert(CONS_ERROR, "Central directory is corrupt\n"); Z_Free(lumpinfo); - free(zentry); + free(zentries); return NULL; } @@ -585,7 +585,7 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp) { CONS_Alert(CONS_ERROR, "Unable to read lumpname (%s)\n", strerror(ferror(handle))); Z_Free(lumpinfo); - free(zentry); + free(zentries); free(fullname); return NULL; } @@ -627,6 +627,8 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp) } } + free(zentries); + *nlmp = numlumps; return lumpinfo; }