motiejus/zig

fork of https://codeberg.org/ziglang/zig
git clone https://git.jakstys.lt/motiejus/zig.git
Log | Tree | Refs | README | LICENSE

commit 7d63e777a49cbd6a906faa80bcde41346ad70546 (tree)
parent 6002514b72cb2a571abc6ac4ac7fbec44d6302b1
Author: Alex Kladov <aleksey.kladov@gmail.com>
Date:   Wed, 16 Jul 2025 10:38:18 +0100

fix memory leak

closes #24421

Diffstat:
Mlib/std/Build/Cache.zig | 1+
1 file changed, 1 insertion(+), 0 deletions(-)

diff --git a/lib/std/Build/Cache.zig b/lib/std/Build/Cache.zig @@ -419,6 +419,7 @@ pub const Manifest = struct { fn addFileInner(self: *Manifest, prefixed_path: PrefixedPath, handle: ?fs.File, max_file_size: ?usize) usize { const gop = self.files.getOrPutAssumeCapacityAdapted(prefixed_path, FilesAdapter{}); if (gop.found_existing) { + self.cache.gpa.free(prefixed_path.sub_path); gop.key_ptr.updateMaxSize(max_file_size); gop.key_ptr.updateHandle(handle); return gop.index;