debug: fix memory leak when an error occurs opening a pdb file

This commit is contained in:
kcbanner committed 2023-07-20 22:58:13 -04:00
1 parent 865d4d2d8c
commit dd2035735f
1 file changed
+1
+1
View File
@@ -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..]);