fix memory leak in std.debug.openSelfDebugInfo()

This commit is contained in:
Ben Noordhuis 2018-02-19 23:06:54 +01:00
parent ab48934e9c
commit 2b35615ffb

View File

@ -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,