From f1b63fc1ad0b62262c069b2e1615737b2bb63631 Mon Sep 17 00:00:00 2001 From: Fabrice Bellard Date: Sat, 21 Mar 2026 14:26:00 +0100 Subject: [PATCH] Fix memory leak in Iterator.prototype.map (saghul) (#493) --- quickjs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/quickjs.c b/quickjs.c index f6104bb..f6ff4a8 100644 --- a/quickjs.c +++ b/quickjs.c @@ -43960,6 +43960,7 @@ static JSValue js_iterator_helper_next(JSContext *ctx, JSValueConst this_val, args[1] = index_val; ret = JS_Call(ctx, it->func, JS_UNDEFINED, countof(args), args); JS_FreeValue(ctx, index_val); + JS_FreeValue(ctx, item); if (JS_IsException(ret)) goto fail; goto done;