mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
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
b0eb351d77
commit
d3b8e07a98
@ -382,7 +382,8 @@ copy_env (char ** const envp)
|
|||||||
entries = 0;
|
entries = 0;
|
||||||
while (envp[entries] != NULL)
|
while (envp[entries] != NULL)
|
||||||
{
|
{
|
||||||
newenv[entries] = strdup (envp[entries]);
|
newenv[entries] = new char[strlen (envp[entries]) + 1];
|
||||||
|
strcpy (newenv[entries], envp[entries]);
|
||||||
++entries;
|
++entries;
|
||||||
}
|
}
|
||||||
newenv[entries] = NULL;
|
newenv[entries] = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user