Skip to content

Commit 5fdc969

Browse files
past-dueFabrice Bellard
authored andcommitted
removed js_array_every() memory leak
Cherry-pick of bellard/quickjs@de4d392 Co-authored-by: Fabrice Bellard <[email protected]>
1 parent d100933 commit 5fdc969

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

quickjs.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39936,8 +39936,10 @@ static JSValue js_array_every(JSContext *ctx, JSValueConst this_val,
3993639936
goto exception;
3993739937
args[0] = ret;
3993839938
res = JS_Invoke(ctx, arr, JS_ATOM_set, 1, args);
39939-
if (check_exception_free(ctx, res))
39939+
if (check_exception_free(ctx, res)) {
39940+
JS_FreeValue(ctx, arr);
3994039941
goto exception;
39942+
}
3994139943
JS_FreeValue(ctx, ret);
3994239944
ret = arr;
3994339945
}

0 commit comments

Comments
 (0)