about summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorFabrice Bellard <fabrice@bellard.org>2023-12-27 17:20:10 +0100
committerbptato <nincsnevem662@gmail.com>2023-12-28 22:14:38 +0100
commit43b34e0e3ef85c4b3593e7189474c34776fdb72b (patch)
tree3a93a39674922d5c25be7eb3a117139db4c29abc /lib
parent281e650fbcc4529a7d5835ac2389ffa575a57ea0 (diff)
downloadchawan-43b34e0e3ef85c4b3593e7189474c34776fdb72b.tar.gz
removed memory leak
Diffstat (limited to 'lib')
-rw-r--r--lib/quickjs/quickjs.c4
1 files changed, 3 insertions, 1 deletions
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);