Skip to content

Commit

Permalink
Fix memory leak in bootstrap_compiler (#620)
Browse files Browse the repository at this point in the history
  • Loading branch information
Akuli authored Jan 15, 2025
1 parent dd88edc commit 39c97a6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bootstrap_compiler/codegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ static LLVMTypeRef codegen_function_type(const Signature *sig)
else
returntype = codegen_type(sig->returntype);

return LLVMFunctionType(returntype, argtypes, sig->nargs, sig->takes_varargs);
LLVMTypeRef functype = LLVMFunctionType(returntype, argtypes, sig->nargs, sig->takes_varargs);
free(argtypes);
return functype;
}

static LLVMValueRef codegen_function_or_method_decl(const struct State *st, const Signature *sig)
Expand Down

0 comments on commit 39c97a6

Please sign in to comment.