From 9931b5634b2ecafdb3a973dba1c93ee69d221f11 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Mon, 11 Mar 2013 17:10:00 +0000 Subject: [PATCH] Fixed a crash in LeakFinder when out of memory git-svn-id: http://mc-server.googlecode.com/svn/trunk@1265 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/LeakFinder.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/LeakFinder.cpp b/source/LeakFinder.cpp index c1446291f..2702fb47a 100644 --- a/source/LeakFinder.cpp +++ b/source/LeakFinder.cpp @@ -427,6 +427,11 @@ public: pHashEntry->Next = (AllocHashEntryType*) own_malloc(sizeof(AllocHashEntryType)); pHashEntry = pHashEntry->Next; + if (pHashEntry == NULL) + { + // Exhausted the available memory? + return; + } } pHashEntry->key = key; pHashEntry->nDataSize = nDataSize;