Skip to content

Commit

Permalink
llvm-c-test: Don't leak memory buffers.
Browse files Browse the repository at this point in the history
Detected by valgrind.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193416 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
d0k committed Oct 25, 2013
1 parent b94be5f commit 50c5b46
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/llvm-c-test/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 50c5b46

Please sign in to comment.