From 2b35615ffbe238c8ec421654a7e1ae0890477fe0 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Mon, 19 Feb 2018 23:06:54 +0100 Subject: [PATCH] fix memory leak in std.debug.openSelfDebugInfo() --- std/debug/index.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/std/debug/index.zig b/std/debug/index.zig index 2418654986..5de201b0e6 100644 --- a/std/debug/index.zig +++ b/std/debug/index.zig @@ -239,6 +239,7 @@ pub fn openSelfDebugInfo(allocator: &mem.Allocator) !&ElfStackTrace { switch (builtin.object_format) { builtin.ObjectFormat.elf => { const st = try allocator.create(ElfStackTrace); + errdefer allocator.destroy(st); *st = ElfStackTrace { .self_exe_file = undefined, .elf = undefined,