File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -33883,7 +33883,7 @@ static JSValue JS_ReadFunctionTag(BCReaderState *s)
33883
33883
if (bc_get_u8(s, &v8))
33884
33884
goto fail;
33885
33885
bc.js_mode = v8;
33886
- if (bc_get_atom(s, &bc.func_name)) //@ atom leak if failure
33886
+ if (bc_get_atom(s, &bc.func_name))
33887
33887
goto fail;
33888
33888
if (bc_get_leb128_u16(s, &bc.arg_count))
33889
33889
goto fail;
@@ -33914,9 +33914,10 @@ static JSValue JS_ReadFunctionTag(BCReaderState *s)
33914
33914
33915
33915
b = js_mallocz(ctx, function_size);
33916
33916
if (!b)
33917
- return JS_EXCEPTION ;
33917
+ goto fail ;
33918
33918
33919
33919
memcpy(b, &bc, sizeof(*b));
33920
+ bc.func_name = JS_ATOM_NULL;
33920
33921
b->header.ref_count = 1;
33921
33922
if (local_count != 0) {
33922
33923
b->vardefs = (void *)((uint8_t*)b + vardefs_offset);
@@ -34059,6 +34060,7 @@ static JSValue JS_ReadFunctionTag(BCReaderState *s)
34059
34060
b->realm = JS_DupContext(ctx);
34060
34061
return obj;
34061
34062
fail:
34063
+ JS_FreeAtom(ctx, bc.func_name);
34062
34064
JS_FreeValue(ctx, obj);
34063
34065
return JS_EXCEPTION;
34064
34066
}
You can’t perform that action at this time.
0 commit comments