Compare commits

...

1 Commits

Author SHA1 Message Date
Dylan Conway
c1a9098b94 fix(shell): remove double-free in createShellInterpreter error path
When `globalThis.hasException()` is true after `Interpreter.init` succeeds,
the code was calling both `shargs.deinit()` and `interpreter.finalize()`.
Since `interpreter.args == shargs`, and `finalize()` calls `this.args.deinit()`,
this caused a double-free of the ShellArgs object, corrupting the heap.

The fix removes the redundant `shargs.deinit()` call since `finalize()`
already handles cleanup.

Fixes BUN-ZFQ

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-07 11:00:30 -08:00

View File

@@ -748,7 +748,6 @@ pub const Interpreter = struct {
jsobjs.deinit();
if (export_env) |*ee| ee.deinit();
if (cwd) |*cc| cc.deref();
shargs.deinit();
interpreter.finalize();
return error.JSError;
}