* 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:
Tomas Hajny 2006-06-24 22:54:12 +00:00
parent 1ecf556685
commit c40e0d9b6f

View File

@ -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