mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-13 14:49:47 +02:00
Avoid infinite loops with RTE 204 if heap is corrupted
git-svn-id: trunk@23845 -
This commit is contained in:
parent
18ece9cf75
commit
503b8c73c2
@ -1571,6 +1571,9 @@ var
|
||||
i : longint;
|
||||
{$endif}
|
||||
begin
|
||||
{ Do not try to do anything if the heap manager already reported an error }
|
||||
if (errorcode=203) or (errorcode=204) then
|
||||
exit;
|
||||
loc_freelists := @freelists;
|
||||
{$ifdef FPC_HAS_FEATURE_THREADING}
|
||||
if heap_lock_use > 0 then
|
||||
|
@ -989,10 +989,14 @@ Begin
|
||||
{$endif}
|
||||
{$ifdef LINUX}
|
||||
{sysfreemem already checks for nil}
|
||||
sysfreemem(calculated_cmdline);
|
||||
{ Do not try to do anything if the heap manager already reported an error }
|
||||
if (errorcode<>203) and (errorcode<>204) then
|
||||
sysfreemem(calculated_cmdline);
|
||||
{$endif}
|
||||
{$ifdef BSD}
|
||||
sysfreemem(cmdline);
|
||||
{ Do not try to do anything if the heap manager already reported an error }
|
||||
if (errorcode<>203) and (errorcode<>204) then
|
||||
sysfreemem(cmdline);
|
||||
{$endif}
|
||||
|
||||
{$ifdef FPC_HAS_FEATURE_HEAP}
|
||||
|
Loading…
Reference in New Issue
Block a user