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:
parent
0217b1beb3
commit
a2748c267b
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue