Skip to content

Commit efb1b6d

Browse files
authored
Fix memory leak in call() retptr allocation (#295)
Signed-off-by: Ludvig Liljenberg <[email protected]>
1 parent 0e5d8e9 commit efb1b6d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

embedding/embedding.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ __attribute__((export_name("call"))) uint32_t call(uint32_t fn_idx,
232232
void *retptr = nullptr;
233233
if (fn->retptr) {
234234
LOG("(call) setting retptr at arg %d\n", argcnt);
235-
retptr = JS_realloc(Runtime.cx, 0, 0, fn->retsize);
235+
retptr = cabi_realloc(nullptr, 0, 4, fn->retsize);
236236
args[argcnt].setInt32((uint32_t)retptr);
237237
}
238238

0 commit comments

Comments
 (0)