mirror of
https://github.com/ziglang/zig.git
synced 2026-11-22 04:37:39 -05:00
debug: fix memory leak when an error occurs opening a pdb file
This commit is contained in:
1 parent
865d4d2d8c
commit
dd2035735f
1 file changed
+1
@@ -881,6 +881,7 @@ fn readCoffDebugInfo(allocator: mem.Allocator, coff_bytes: []const u8) !ModuleDe
|
||||
|
||||
// Only used by pdb path
|
||||
di.coff_section_headers = try coff_obj.getSectionHeadersAlloc(allocator);
|
||||
errdefer allocator.free(di.coff_section_headers);
|
||||
|
||||
var path_buf: [windows.MAX_PATH]u8 = undefined;
|
||||
const len = try coff_obj.getPdbPath(path_buf[0..]);
|
||||
|
||||
Reference in new issue
Block a user