mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 19:08:50 +00:00
Fix memory leak in Bun.spawn (#20095)
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user