summaryrefslogtreecommitdiff
path: root/src/fs/virtfs/zipreader.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-07-17 18:55:36 +0300
committerAndrei Karas <akaras@inbox.ru>2017-07-17 18:55:36 +0300
commit4ecdb004e81a459ea63ebd7127e1c945df43f9ce (patch)
treea8ece58a62724c4b088484e0b5c1f44fdbf2f7e1 /src/fs/virtfs/zipreader.cpp
parent334c1c50dfa57da0b91687e097db295a6a3b699b (diff)
downloadplus-4ecdb004e81a459ea63ebd7127e1c945df43f9ce.tar.gz
plus-4ecdb004e81a459ea63ebd7127e1c945df43f9ce.tar.bz2
plus-4ecdb004e81a459ea63ebd7127e1c945df43f9ce.tar.xz
plus-4ecdb004e81a459ea63ebd7127e1c945df43f9ce.zip
Fix issues detected by coverity.
Diffstat (limited to 'src/fs/virtfs/zipreader.cpp')
-rw-r--r--src/fs/virtfs/zipreader.cpp6
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;