From 44f90c93e64d756d3dae0a3e900f98d1e24b2dd5 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 14 May 2006 18:38:13 +0000 Subject: [PATCH] Delete memory allocated by CopyEnv llvm-svn: 28288 --- llvm/tools/llvm-ld/llvm-ld.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/llvm/tools/llvm-ld/llvm-ld.cpp b/llvm/tools/llvm-ld/llvm-ld.cpp index 46fd29147630..1900cc9866a4 100644 --- a/llvm/tools/llvm-ld/llvm-ld.cpp +++ b/llvm/tools/llvm-ld/llvm-ld.cpp @@ -312,7 +312,9 @@ static int GenerateNative(const std::string &OutputFilename, args.push_back(0); // Run the compiler to assembly and link together the program. - return sys::Program::ExecuteAndWait(gcc, &args[0], (const char**)clean_env); + int R = sys::Program::ExecuteAndWait(gcc, &args[0], (const char**)clean_env); + delete [] clean_env; + return R; } /// EmitShellScript - Output the wrapper file that invokes the JIT on the LLVM