fix(install): clone arena memory on manifest parse errors (#20925)

This commit is contained in:
Dylan Conway
2025-07-09 21:03:51 -07:00
committed by GitHub
parent 6e92f0b9cb
commit a1ef8f00ac

View File

@@ -1572,7 +1572,14 @@ pub const PackageManifest = struct {
source,
log,
arena.allocator(),
) catch return null;
) catch {
// don't use the arena memory!
var cloned_log: logger.Log = .init(bun.default_allocator);
try log.cloneToWithRecycled(&cloned_log, true);
log.* = cloned_log;
return null;
};
if (json.asProperty("error")) |error_q| {
if (error_q.expr.asString(allocator)) |err| {