From: John Criswell Date: Wed, 17 Sep 2003 19:14:41 +0000 (+0000) Subject: Replaced the call to strdup() with a new operator followed by a strcpy(). X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a589d31faa44e0c9175e66417ae57b03959e0675;p=oota-llvm.git 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 --- diff --git a/tools/gccld/gccld.cpp b/tools/gccld/gccld.cpp index c5337873182..608a67e6300 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;