From 4dd9eaf6fc70e959125e734a859d93944bbd7eea Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 12 Feb 2015 08:13:54 -0500 Subject: [PATCH] ceesectionstring: Fix a potential memory leak --- src/md/ceefilegen/ceesectionstring.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/md/ceefilegen/ceesectionstring.cpp b/src/md/ceefilegen/ceesectionstring.cpp index 7a43dd3..314b3a6 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; -- 2.7.4