projects
/
platform
/
upstream
/
coreclr.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c275584
)
ceesectionstring: Fix a potential memory leak
author
Lioncash
<mathew1800@gmail.com>
Thu, 12 Feb 2015 13:13:54 +0000
(08:13 -0500)
committer
Lioncash
<mathew1800@gmail.com>
Thu, 12 Feb 2015 13:13:57 +0000
(08:13 -0500)
src/md/ceefilegen/ceesectionstring.cpp
patch
|
blob
|
history
diff --git
a/src/md/ceefilegen/ceesectionstring.cpp
b/src/md/ceefilegen/ceesectionstring.cpp
index 7a43dd3b999df87146c667ccc0e6d82de55f37fd..314b3a6af9dc3b6261ef1106cefce6fc5e2d6846 100644
(file)
--- 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;