From 71b3beee6c280595898c579cf91928a84fe857d2 Mon Sep 17 00:00:00 2001 From: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com> Date: Mon, 15 Sep 2025 16:47:31 -0700 Subject: [PATCH] Fix memory leak in call() retptr allocation Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com> --- embedding/embedding.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/embedding/embedding.cpp b/embedding/embedding.cpp index eaa99bda..68463f8f 100644 --- a/embedding/embedding.cpp +++ b/embedding/embedding.cpp @@ -232,7 +232,7 @@ __attribute__((export_name("call"))) uint32_t call(uint32_t fn_idx, void *retptr = nullptr; if (fn->retptr) { LOG("(call) setting retptr at arg %d\n", argcnt); - retptr = JS_realloc(Runtime.cx, 0, 0, fn->retsize); + retptr = cabi_realloc(nullptr, 0, 4, fn->retsize); args[argcnt].setInt32((uint32_t)retptr); }