diff --git a/quickjs-libc.c b/quickjs-libc.c index 7485001eb..c1d3f804f 100644 --- a/quickjs-libc.c +++ b/quickjs-libc.c @@ -4586,6 +4586,7 @@ void js_std_eval_binary(JSContext *ctx, const uint8_t *buf, size_t buf_len, if (js_module_set_import_meta(ctx, obj, false, false) < 0) goto exception; } + JS_FreeValue(ctx, obj); } else { if (JS_VALUE_GET_TAG(obj) == JS_TAG_MODULE) { if (JS_ResolveModule(ctx, obj) < 0) { diff --git a/quickjs.c b/quickjs.c index f63b7df66..60d33cf8f 100644 --- a/quickjs.c +++ b/quickjs.c @@ -39934,8 +39934,10 @@ static JSValue js_array_every(JSContext *ctx, JSValueConst this_val, goto exception; args[0] = ret; res = JS_Invoke(ctx, arr, JS_ATOM_set, 1, args); - if (check_exception_free(ctx, res)) + if (check_exception_free(ctx, res)) { + JS_FreeValue(ctx, arr); goto exception; + } JS_FreeValue(ctx, ret); ret = arr; }