mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 20:29:17 +02:00
+ check for < 0 which otherwise segfaulted
This commit is contained in:
parent
3e8bbe3edd
commit
0ffc0f5586
@ -548,8 +548,12 @@ begin
|
|||||||
inc(size,sizeof(heap_mem_info));
|
inc(size,sizeof(heap_mem_info));
|
||||||
end;
|
end;
|
||||||
{$endif CHECKHEAP}
|
{$endif CHECKHEAP}
|
||||||
if size=0 then
|
{ Something to allocate ? }
|
||||||
|
if size<=0 then
|
||||||
begin
|
begin
|
||||||
|
{ give an error for < 0 }
|
||||||
|
if size<0 then
|
||||||
|
HandleError(204);
|
||||||
p:=heapend;
|
p:=heapend;
|
||||||
{$ifdef CHECKHEAP}
|
{$ifdef CHECKHEAP}
|
||||||
goto check_new;
|
goto check_new;
|
||||||
@ -712,8 +716,10 @@ var
|
|||||||
label
|
label
|
||||||
freemem_exit;
|
freemem_exit;
|
||||||
begin
|
begin
|
||||||
if size=0 then
|
if size<=0 then
|
||||||
begin
|
begin
|
||||||
|
if size<0 then
|
||||||
|
HandleError(204);
|
||||||
p:=nil;
|
p:=nil;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
@ -1080,7 +1086,10 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.2 1998-10-01 14:55:17 peter
|
Revision 1.3 1998-10-22 23:50:45 peter
|
||||||
|
+ check for < 0 which otherwise segfaulted
|
||||||
|
|
||||||
|
Revision 1.2 1998/10/01 14:55:17 peter
|
||||||
+ memorymanager like delphi
|
+ memorymanager like delphi
|
||||||
|
|
||||||
Revision 1.1 1998/09/14 10:48:17 peter
|
Revision 1.1 1998/09/14 10:48:17 peter
|
||||||
|
Loading…
Reference in New Issue
Block a user