summaryrefslogtreecommitdiffstats
path: root/llvm/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
commita2748c267b92d435a27ba3d17fa55d67ef37d9b2 (patch)
treefdbd313a46ce4f36fb8c9ca6fe572e5995a48799 /llvm/tools/gccld/gccld.cpp
parent0217b1beb36510084fc0073d6e2652a113f383e5 (diff)
downloadbcm5719-llvm-a2748c267b92d435a27ba3d17fa55d67ef37d9b2.tar.gz
bcm5719-llvm-a2748c267b92d435a27ba3d17fa55d67ef37d9b2.zip
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
Diffstat (limited to 'llvm/tools/gccld/gccld.cpp')
-rw-r--r--llvm/tools/gccld/gccld.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/tools/gccld/gccld.cpp b/llvm/tools/gccld/gccld.cpp
index c5337873182..608a67e6300 100644
--- a/llvm/tools/gccld/gccld.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud