Replaced the call to strdup() with a new operator followed by a strcpy().

This should prevent calls to the new oerator and malloc.

llvm-svn: 8587
This commit is contained in:
John Criswell 2003-09-17 19:14:41 +00:00
parent 0217b1beb3
commit a2748c267b
1 changed files with 2 additions and 1 deletions

View File

@ -382,7 +382,8 @@ copy_env (char ** const envp)
entries = 0;
while (envp[entries] != NULL)
{
newenv[entries] = strdup (envp[entries]);
newenv[entries] = new char[strlen (envp[entries]) + 1];
strcpy (newenv[entries], envp[entries]);
++entries;
}
newenv[entries] = NULL;