aboutsummaryrefslogtreecommitdiff
path: root/tools/gccld/gccld.cpp
diff options
context:
space:
mode:
authorJohn Criswell <criswell@uiuc.edu>2003-09-17 19:14:41 +0000
committerJohn Criswell <criswell@uiuc.edu>2003-09-17 19:14:41 +0000
commita589d31faa44e0c9175e66417ae57b03959e0675 (patch)
tree64f92e3bfc6b3302571f063d3afbf8095eb3a520 /tools/gccld/gccld.cpp
parent83ca6ec8a3e10c91b3c5a11ec6285ddc31b5a1ae (diff)
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
Diffstat (limited to 'tools/gccld/gccld.cpp')
-rw-r--r--tools/gccld/gccld.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/gccld/gccld.cpp b/tools/gccld/gccld.cpp
index c533787318..608a67e630 100644
--- a/tools/gccld/gccld.cpp
+++ b/tools/gccld/gccld.cpp
@@ -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;