[llvm-commits] [llvm] r123487 - /llvm/trunk/tools/llvm-ld/llvm-ld.cpp
Ted Kremenek
kremenek at apple.com
Fri Jan 14 14:34:17 PST 2011
Author: kremenek
Date: Fri Jan 14 16:34:17 2011
New Revision: 123487
URL: http://llvm.org/viewvc/llvm-project?rev=123487&view=rev
Log:
Fix memory leak found by clang static analyzer.
Modified:
llvm/trunk/tools/llvm-ld/llvm-ld.cpp
Modified: llvm/trunk/tools/llvm-ld/llvm-ld.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-ld/llvm-ld.cpp?rev=123487&r1=123486&r2=123487&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-ld/llvm-ld.cpp (original)
+++ llvm/trunk/tools/llvm-ld/llvm-ld.cpp Fri Jan 14 16:34:17 2011
@@ -178,7 +178,7 @@
// Allocate a new environment list.
char **newenv = new char* [entries];
- if ((newenv = new char* [entries]) == NULL)
+ if (newenv == NULL)
return NULL;
// Make a copy of the list. Don't forget the NULL that ends the list.
More information about the llvm-commits
mailing list