* return nil in SysTinyReallocMem, when the size parameter is 0

git-svn-id: trunk@26892 -
This commit is contained in:
nickysn 2014-02-26 23:31:50 +00:00
parent 03415e1cac
commit 640f6ea300

View File

@ -216,7 +216,10 @@
{$ifdef DEBUG_TINY_HEAP}
Write('SysTinyReAllocMem(', ptruint(p), ',', size, ')=');
{$endif DEBUG_TINY_HEAP}
result := AllocMem(size);
if size=0 then
result := nil
else
result := AllocMem(size);
if result <> nil then
begin
if p <> nil then