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

This should prevent calls to the new oerator and malloc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8587 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
John Criswell 2003-09-17 19:14:41 +00:00
parent 83ca6ec8a3
commit a589d31faa

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;