summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-03-11 10:05:07 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-03-11 14:08:36 +0000
commit3aebfbc2996beb171aa3badc1e757ddb0514de45 (patch)
treef3040971ead098242152f079f003b231949c9921 /shell
parenta4d67c9c9c2672ca6d2405075790e0891930b2e0 (diff)
leak on short read
Change-Id: I5da7ec2992f9f0b20aa075ee33d0b882cdf91901
Diffstat (limited to 'shell')
-rw-r--r--shell/source/win32/zipfile/zipfile.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/shell/source/win32/zipfile/zipfile.cxx b/shell/source/win32/zipfile/zipfile.cxx
index ac9f9a0cec30..a7708dcfb391 100644
--- a/shell/source/win32/zipfile/zipfile.cxx
+++ b/shell/source/win32/zipfile/zipfile.cxx
@@ -136,7 +136,10 @@ static std::string readString(StreamInterface *stream, unsigned long size)
unsigned char *tmp = new unsigned char[size];
unsigned long numBytesRead = stream->sread(tmp, size);
if (numBytesRead != size)
+ {
+ delete [] tmp;
throw IOException(-1);
+ }
std::string aStr((char *)tmp, size);
delete [] tmp;