diff options
| author | John Criswell <criswell@uiuc.edu> | 2003-09-17 19:14:41 +0000 |
|---|---|---|
| committer | John Criswell <criswell@uiuc.edu> | 2003-09-17 19:14:41 +0000 |
| commit | a2748c267b92d435a27ba3d17fa55d67ef37d9b2 (patch) | |
| tree | fdbd313a46ce4f36fb8c9ca6fe572e5995a48799 /llvm/tools/gccld/gccld.cpp | |
| parent | 0217b1beb36510084fc0073d6e2652a113f383e5 (diff) | |
| download | bcm5719-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.cpp | 3 |
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; |

