From 3aebfbc2996beb171aa3badc1e757ddb0514de45 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 11 Mar 2015 10:05:07 +0000 Subject: leak on short read Change-Id: I5da7ec2992f9f0b20aa075ee33d0b882cdf91901 --- shell/source/win32/zipfile/zipfile.cxx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'shell/source') 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; -- cgit