From: Andres Freund Date: Mon, 26 Mar 2018 23:04:39 +0000 (-0700) Subject: LLVMJIT: Free created module in LLVM < 5. X-Git-Tag: REL_11_BETA1~473 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=071371bc43c89d6db923a7f858933f655b150655;p=thirdparty%2Fpostgresql.git LLVMJIT: Free created module in LLVM < 5. Due to the differing APIs between versions, I forgot to deallocate the generated module in older LLVM versions, leading to a memory leak. Author: Andres Freund --- diff --git a/src/backend/jit/llvm/llvmjit.c b/src/backend/jit/llvm/llvmjit.c index bbf30b31552..53ac8e4425b 100644 --- a/src/backend/jit/llvm/llvmjit.c +++ b/src/backend/jit/llvm/llvmjit.c @@ -531,6 +531,7 @@ llvm_compile_module(LLVMJitContext *context) { orc_handle = LLVMOrcAddEagerlyCompiledIR(compile_orc, context->module, llvm_resolve_symbol, NULL); + LLVMDisposeModule(context->module); } #else {