projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
83ca6ec
)
Replaced the call to strdup() with a new operator followed by a strcpy().
author
John Criswell
<criswell@uiuc.edu>
Wed, 17 Sep 2003 19:14:41 +0000
(19:14 +0000)
committer
John Criswell
<criswell@uiuc.edu>
Wed, 17 Sep 2003 19:14:41 +0000
(19:14 +0000)
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
tools/gccld/gccld.cpp
patch
|
blob
|
history
diff --git
a/tools/gccld/gccld.cpp
b/tools/gccld/gccld.cpp
index c53378731828f1eb7ea9f0103f22ec494324ed10..608a67e6300dd6819743e138aaf3fc0204501738 100644
(file)
--- 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;