From c186f8f08ff34787d034b8494ba0db6aa9d9f567 Mon Sep 17 00:00:00 2001 From: chakrabot Date: Sat, 19 Aug 2017 03:02:36 -0700 Subject: [PATCH] [Merge Microsoft/Chakracore@71d8959010] [MERGE #3235 @xiaoyinl] Fix memory leak in AutoSystemInfo::InitPhysicalProcessorCount Merge pull request #3235 from xiaoyinl:memleak_sysinfo The heap buffer `pBufferStart` is not deleted if `GetLogicalProcessorInformation` fails. --- deps/chakrashim/core/lib/Common/Core/SysInfo.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/deps/chakrashim/core/lib/Common/Core/SysInfo.cpp b/deps/chakrashim/core/lib/Common/Core/SysInfo.cpp index 9aaa3ccec2e..d6a31e636b3 100644 --- a/deps/chakrashim/core/lib/Common/Core/SysInfo.cpp +++ b/deps/chakrashim/core/lib/Common/Core/SysInfo.cpp @@ -166,6 +166,7 @@ AutoSystemInfo::InitPhysicalProcessorCount() bResult = GetLogicalProcessorInformation(pBufferCurrent, &size); if (!bResult) { + NoCheckHeapDeleteArray(count, pBufferStart); return false; }