authorgravatar for rb.lymn@gmail.comRobbie Lyman <rb.lymn@gmail.com> 2026-08-07 11:54:36-04:00
committergravatar for rb.lymn@gmail.comRobbie Lyman <rb.lymn@gmail.com> 2026-08-07 11:54:36-04:00
logc0924842744fea67df49c9942b99d855b83578e5
treef6df93ddc55680ede4f764f88ba3f24af317999f
parent16fbd314dc9590077267fc373b76b7c7b977977a

fix(Allocator): test leak


1 files changed, 5 insertions(+), 2 deletions(-)

lib/std/mem/Allocator.zig+5-2
...@@ -627,7 +627,10 @@ test "free single-pointer to array" {...@@ -627,7 +627,10 @@ test "free single-pointer to array" {
627 const allocation = try allocator.alloc(u32, 128);627 const allocation = try allocator.alloc(u32, 128);
628 allocation[127] = 0;628 allocation[127] = 0;
629 const ptr: *[127:0]u32 = allocation[0..127 :0];629 const ptr: *[127:0]u32 = allocation[0..127 :0];
630 const new = try allocator.realloc(ptr, 16);630 if (allocator.realloc(ptr, 16)) |new| {
631 allocator.free(new);631 allocator.free(new);
632 } else |_| {
633 allocator.free(allocation);
634 }
632 }635 }
633}636}