From a2748c267b92d435a27ba3d17fa55d67ef37d9b2 Mon Sep 17 00:00:00 2001 From: John Criswell Date: Wed, 17 Sep 2003 19:14:41 +0000 Subject: 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 --- llvm/tools/gccld/gccld.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/tools/gccld') 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; -- cgit v1.2.3