summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2016-06-07 10:04:28 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2016-06-07 10:04:28 +0000
commit750e01d70da59b2f615528b3587a6318b4836c69 (patch)
treed87b7417c675411e5a2ce618c93adcae4bc92fa9 /src
parentfeeb51bb1a61ba79ad6fbb4550b11b6e740c46d1 (diff)
mir_core: fix potential memleak
git-svn-id: http://svn.miranda-ng.org/main/trunk@16937 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r--src/mir_core/src/memory.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mir_core/src/memory.cpp b/src/mir_core/src/memory.cpp
index a9ab2f1af9..d2b055a221 100644
--- a/src/mir_core/src/memory.cpp
+++ b/src/mir_core/src/memory.cpp
@@ -2,7 +2,7 @@
Miranda NG: the free IM client for Microsoft* Windows*
-Copyright (ñ) 2012-16 Miranda NG project (http://miranda-ng.org),
+Copyright (�) 2012-16 Miranda NG project (http://miranda-ng.org),
Copyright (c) 2000-12 Miranda IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -107,8 +107,10 @@ MIR_C_CORE_DLL(void*) mir_realloc(void* ptr, size_t size)
}
else p = NULL;
+ ptr = p;
p = (char*)realloc(p, size + sizeof(DWORD)*3);
if (p == NULL) {
+ free(ptr);
OutputDebugStringA("memory overflow\n");
#if defined(_DEBUG)
DebugBreak();