From f0ada1ccc51e7dbb6cadc6d2e4e13a185db87812 Mon Sep 17 00:00:00 2001 From: nickysn Date: Thu, 16 May 2013 22:15:36 +0000 Subject: [PATCH] * fixed bug in SysTinyGetMem that caused heap corruption if the free block that's being allocated is followed tightly by an already allocated block git-svn-id: trunk@24520 - --- rtl/inc/tinyheap.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rtl/inc/tinyheap.inc b/rtl/inc/tinyheap.inc index d608a20f7d..8d180f2a86 100644 --- a/rtl/inc/tinyheap.inc +++ b/rtl/inc/tinyheap.inc @@ -71,7 +71,8 @@ pptruint(p)^ := size; - InternalTinyFreeMem(pointer(ptruint(p)+AllocSize), RestSize); + if RestSize > 0 then + InternalTinyFreeMem(pointer(ptruint(p)+AllocSize), RestSize); end else Result := nil;