Skip to content

Commit 9de7277

Browse files
authored
Use js_free instead of bare free in api-test.c (#1024)
Functionally a no-op when not using a custom allocator but it's more correct and ensures quickjs knows how much memory has been allocated.
1 parent 90b2437 commit 9de7277

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

api-test.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ static void module_serde(void)
217217
JS_FreeValue(ctx, mod);
218218
assert(loader_calls == 1);
219219
mod = JS_ReadObject(ctx, buf, len, JS_READ_OBJ_BYTECODE);
220-
free(buf);
220+
js_free(ctx, buf);
221221
assert(loader_calls == 1); // 'b' is returned from cache
222222
assert(!JS_IsException(mod));
223223
JSValue ret = JS_EvalFunction(ctx, mod);

0 commit comments

Comments
 (0)