From 1094ffa276990fd53abe633e5b14869d7c538a16 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 28 Jan 2022 23:58:46 +0100 Subject: lib: fix memory leak in uc_require_ucode() We need to release the compiled module function after we executed it in our VM context. Signed-off-by: Jo-Philipp Wich --- lib.c | 1 + 1 file changed, 1 insertion(+) (limited to 'lib.c') diff --git a/lib.c b/lib.c index 7b0c9ca..c211f78 100644 --- a/lib.c +++ b/lib.c @@ -1558,6 +1558,7 @@ uc_require_ucode(uc_vm_t *vm, const char *path, uc_value_t *scope, uc_value_t ** *res = uc_vm_stack_pop(vm); uc_source_put(source); + ucv_put(&function->header); return true; } -- cgit v1.2.3