diff --git a/tools/llvm-c-test/module.c b/tools/llvm-c-test/module.c index 180238664f6..2661fc81d88 100644 --- a/tools/llvm-c-test/module.c +++ b/tools/llvm-c-test/module.c @@ -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; }