mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 18:09:30 +02:00
* error handling for potential issues with memory allocation during setup_environment as suggested by borsa77 at libero.it
git-svn-id: trunk@3931 -
This commit is contained in:
parent
1ecf556685
commit
c40e0d9b6f
@ -454,7 +454,7 @@ begin
|
||||
inc(longint(cp)); { skip to next character }
|
||||
end;
|
||||
envp := sysgetmem((env_count+1) * sizeof(pchar));
|
||||
if (envp = nil) then exit;
|
||||
if (envp = nil) then HandleError (203);
|
||||
cp:=dos_env;
|
||||
env_count:=0;
|
||||
while cp^ <> #0 do
|
||||
@ -472,7 +472,7 @@ begin
|
||||
envp[env_count]:=nil;
|
||||
longint(cp):=longint(cp)+3;
|
||||
dos_argv0 := sysgetmem(strlen(cp)+1);
|
||||
if (dos_argv0 = nil) then halt;
|
||||
if (dos_argv0 = nil) then HandleError (203);
|
||||
strcopy(dos_argv0, cp);
|
||||
{ update ___dos_argv0 also }
|
||||
___dos_argv0:=dos_argv0
|
||||
|
Loading…
Reference in New Issue
Block a user