Skip to content

Commit 294f198

Browse files
committed
Fix atom leak in JS_NewSymbol
1 parent c52d198 commit 294f198

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

quickjs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3415,6 +3415,7 @@ JSValue JS_NewSymbol(JSContext *ctx, const char *description, bool is_global)
34153415
JSAtom atom = JS_NewAtom(ctx, description);
34163416
if (atom == JS_ATOM_NULL)
34173417
return JS_EXCEPTION;
3418+
JS_FreeAtom(ctx, atom);
34183419
return JS_NewSymbolFromAtom(ctx, atom, is_global ? JS_ATOM_TYPE_GLOBAL_SYMBOL : JS_ATOM_TYPE_SYMBOL);
34193420
}
34203421

0 commit comments

Comments
 (0)