diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-07-17 18:55:36 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-07-17 18:55:36 +0300 |
commit | 4ecdb004e81a459ea63ebd7127e1c945df43f9ce (patch) | |
tree | a8ece58a62724c4b088484e0b5c1f44fdbf2f7e1 /src/fs/virtfs/zipreader.cpp | |
parent | 334c1c50dfa57da0b91687e097db295a6a3b699b (diff) | |
download | ManaVerse-4ecdb004e81a459ea63ebd7127e1c945df43f9ce.tar.gz ManaVerse-4ecdb004e81a459ea63ebd7127e1c945df43f9ce.tar.bz2 ManaVerse-4ecdb004e81a459ea63ebd7127e1c945df43f9ce.tar.xz ManaVerse-4ecdb004e81a459ea63ebd7127e1c945df43f9ce.zip |
Fix issues detected by coverity.
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; |