diff options
Diffstat (limited to 'src/fs/virtfs/zipreader.cpp')
-rw-r--r-- | src/fs/virtfs/zipreader.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/fs/virtfs/zipreader.cpp b/src/fs/virtfs/zipreader.cpp index 017686e6b..7f3e48463 100644 --- a/src/fs/virtfs/zipreader.cpp +++ b/src/fs/virtfs/zipreader.cpp @@ -27,6 +27,7 @@ #include "utils/cast.h" #include "utils/checkutils.h" +#include "utils/delete2.h" #include "utils/stringutils.h" #include <zlib.h> @@ -55,7 +56,7 @@ extern const char *dirSeparator; { \ reportAlways("Error reading " msg " in file %s", \ archiveName.c_str()); \ - delete header; \ + delete2(header); \ delete [] buf; \ fclose(arcFile); \ return false; \ @@ -290,7 +291,10 @@ namespace ZipReader const size_t outSize = header->uncompressSize; uint8_t *restrict const out = new uint8_t[outSize]; if (outSize == 0) + { + delete [] in; return out; + } z_stream strm; strm.zalloc = nullptr; |