mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
debug: fix memory leak when an error occurs opening a pdb file
This commit is contained in:
parent
865d4d2d8c
commit
dd2035735f
1 changed files with 1 additions and 0 deletions
|
|
@ -881,6 +881,7 @@ fn readCoffDebugInfo(allocator: mem.Allocator, coff_bytes: []const u8) !ModuleDe
|
||||||
|
|
||||||
// Only used by pdb path
|
// Only used by pdb path
|
||||||
di.coff_section_headers = try coff_obj.getSectionHeadersAlloc(allocator);
|
di.coff_section_headers = try coff_obj.getSectionHeadersAlloc(allocator);
|
||||||
|
errdefer allocator.free(di.coff_section_headers);
|
||||||
|
|
||||||
var path_buf: [windows.MAX_PATH]u8 = undefined;
|
var path_buf: [windows.MAX_PATH]u8 = undefined;
|
||||||
const len = try coff_obj.getPdbPath(path_buf[0..]);
|
const len = try coff_obj.getPdbPath(path_buf[0..]);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue