summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2015-02-12 08:13:54 -0500
committerLioncash <mathew1800@gmail.com>2015-02-12 08:13:57 -0500
commit4dd9eaf6fc70e959125e734a859d93944bbd7eea (patch)
tree87f2b7f4018b5ea4c64465269a4b79f492e111c7 /src
parentc2755846bfdfec5bfdfe6e7b40063b98ce819c3c (diff)
downloadcoreclr-4dd9eaf6fc70e959125e734a859d93944bbd7eea.tar.gz
coreclr-4dd9eaf6fc70e959125e734a859d93944bbd7eea.tar.bz2
coreclr-4dd9eaf6fc70e959125e734a859d93944bbd7eea.zip
ceesectionstring: Fix a potential memory leak
Diffstat (limited to 'src')
-rw-r--r--src/md/ceefilegen/ceesectionstring.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/md/ceefilegen/ceesectionstring.cpp b/src/md/ceefilegen/ceesectionstring.cpp
index 7a43dd3b99..314b3a6af9 100644
--- a/src/md/ceefilegen/ceesectionstring.cpp
+++ b/src/md/ceefilegen/ceesectionstring.cpp
@@ -74,8 +74,10 @@ StringTableEntry* CeeSectionString::createEntry(__in_z LPWSTR target, ULONG hash
entry->m_hashId = hashId;
entry->m_offset = dataLen();
size_t len = (wcslen(target)+1) * sizeof(wchar_t);
- if (len > ULONG_MAX)
+ if (len > ULONG_MAX) {
+ delete entry;
return NULL;
+ }
void *buf = getBlock((ULONG)len);
if (!buf) {
delete entry;