[llvm] r193416 - llvm-c-test: Don't leak memory buffers.
Benjamin Kramer
benny.kra at googlemail.com
Fri Oct 25 08:58:58 PDT 2013
Author: d0k
Date: Fri Oct 25 10:58:58 2013
New Revision: 193416
URL: http://llvm.org/viewvc/llvm-project?rev=193416&view=rev
Log:
llvm-c-test: Don't leak memory buffers.
Detected by valgrind.
Modified:
llvm/trunk/tools/llvm-c-test/module.c
Modified: llvm/trunk/tools/llvm-c-test/module.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-c-test/module.c?rev=193416&r1=193415&r2=193416&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-c-test/module.c (original)
+++ llvm/trunk/tools/llvm-c-test/module.c Fri Oct 25 10:58:58 2013
@@ -31,9 +31,11 @@ static LLVMModuleRef load_module(void) {
if (LLVMParseBitcode(MB, &M, &msg)) {
fprintf(stderr, "Error parsing bitcode: %s\n", msg);
+ LLVMDisposeMemoryBuffer(MB);
exit(1);
}
+ LLVMDisposeMemoryBuffer(MB);
return M;
}
More information about the llvm-commits
mailing list