From 43b34e0e3ef85c4b3593e7189474c34776fdb72b Mon Sep 17 00:00:00 2001 From: Fabrice Bellard Date: Wed, 27 Dec 2023 17:20:10 +0100 Subject: removed memory leak --- lib/quickjs/quickjs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/quickjs/quickjs.c') diff --git a/lib/quickjs/quickjs.c b/lib/quickjs/quickjs.c index 6d6d9d8f..b864cc6d 100644 --- a/lib/quickjs/quickjs.c +++ b/lib/quickjs/quickjs.c @@ -24352,8 +24352,10 @@ static __exception int js_parse_postfix_expr(JSParseState *s, int parse_flags) return -1; } name = JS_DupAtom(s->ctx, s->token.u.ident.atom); - if (next_token(s)) /* update line number before emitting code */ + if (next_token(s)) { /* update line number before emitting code */ + JS_FreeAtom(s->ctx, name); return -1; + } do_get_var: emit_op(s, OP_scope_get_var); emit_u32(s, name); -- cgit 1.4.1-2-gfad0