diff options
author | Lioncash <mathew1800@gmail.com> | 2015-02-12 08:13:54 -0500 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2015-02-12 08:13:57 -0500 |
commit | 4dd9eaf6fc70e959125e734a859d93944bbd7eea (patch) | |
tree | 87f2b7f4018b5ea4c64465269a4b79f492e111c7 /src/md | |
parent | c2755846bfdfec5bfdfe6e7b40063b98ce819c3c (diff) | |
download | coreclr-4dd9eaf6fc70e959125e734a859d93944bbd7eea.tar.gz coreclr-4dd9eaf6fc70e959125e734a859d93944bbd7eea.tar.bz2 coreclr-4dd9eaf6fc70e959125e734a859d93944bbd7eea.zip |
ceesectionstring: Fix a potential memory leak
Diffstat (limited to 'src/md')
-rw-r--r-- | src/md/ceefilegen/ceesectionstring.cpp | 4 |
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; |