From ab81de751460241a3e705db92618d93d6744911f Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 14 May 2006 19:17:28 +0000 Subject: [PATCH] Free memory allocated by copy_env. llvm-svn: 28299 --- llvm/tools/gccld/GenerateCode.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/llvm/tools/gccld/GenerateCode.cpp b/llvm/tools/gccld/GenerateCode.cpp index 9dffe332e48a..967fbf0b803e 100644 --- a/llvm/tools/gccld/GenerateCode.cpp +++ b/llvm/tools/gccld/GenerateCode.cpp @@ -438,7 +438,9 @@ int llvm::GenerateNative(const std::string &OutputFilename, // Run the compiler to assembly and link together the program. if (Verbose) dumpArgs(&args[0]); - int Res = sys::Program::ExecuteAndWait(gcc, &args[0], (const char**)clean_env); + int Res = sys::Program::ExecuteAndWait(gcc, &args[0],(const char**)clean_env); + + delete [] clean_env; while (!StringsToDelete.empty()) { free(StringsToDelete.back());