summaryrefslogtreecommitdiffhomepage
path: root/lib.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2022-01-28 23:58:46 +0100
committerJo-Philipp Wich <jo@mein.io>2022-01-29 23:33:07 +0100
commit1094ffa276990fd53abe633e5b14869d7c538a16 (patch)
tree96bd5908ea5ad1ba81ecb0915ab8059970f09775 /lib.c
parentddc5aa7cd3121300f2ba6e68cb038258a616d4e4 (diff)
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 <jo@mein.io>
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c1
1 files changed, 1 insertions, 0 deletions
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;
}