authorgravatar for kcbanner@gmail.comCasey Banner <kcbanner@gmail.com> 2023-01-08 22:16:16-05:00
committergravatar for kcbanner@gmail.comCasey Banner <kcbanner@gmail.com> 2023-01-08 22:16:16-05:00
log5e3cadf871ab800d90c85f39cc28b922539d4dbf
treea15db66aff93574b4a0e909e8ade31cc1f55ac25
parent461fb499f3cff9038a427eae120fb34defc9ab38

debug: fixup memory management


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

lib/std/debug.zig+2-1
......@@ -838,7 +838,7 @@ pub fn openSelfDebugInfo(allocator: mem.Allocator) OpenSelfDebugInfoError!DebugI
838838fn readCoffDebugInfo(allocator: mem.Allocator, coff_bytes: []const u8) !ModuleDebugInfo {
839839 nosuspend {
840840 const coff_obj = try allocator.create(coff.Coff);
841 errdefer allocator.destroy(coff_obj);
841 defer allocator.destroy(coff_obj);
842842 coff_obj.* = try coff.Coff.init(coff_bytes);
843843
844844 var di = ModuleDebugInfo{
......@@ -1289,6 +1289,7 @@ pub const DebugInfo = struct {
12891289 self.allocator.destroy(mdi);
12901290 }
12911291 self.address_map.deinit();
1292 if (native_os == .windows) self.modules.deinit(self.allocator);
12921293 }
12931294
12941295 pub fn getModuleForAddress(self: *DebugInfo, address: usize) !*ModuleDebugInfo {