Fix memory leak in Bun.spawn (#20095)

Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
This commit is contained in:
Jarred Sumner
2025-05-31 20:06:22 -07:00
committed by GitHub
parent 284de53f26
commit 390798c172
15 changed files with 132 additions and 55 deletions

View File

@@ -276,7 +276,7 @@ pub fn sliceWithSentinel(self: *MutableString) [:0]u8 {
}
pub fn toOwnedSliceLength(self: *MutableString, length: usize) string {
self.list.shrinkAndFree(self.allocator, length);
self.list.items.len = length;
return self.list.toOwnedSlice(self.allocator) catch bun.outOfMemory(); // TODO
}