Re: [PATCH] libdwfl: Fix fd leak/closing wrong fd after dwfl_core_file_report()

2019-08-09 Thread Mark Wielaard
Hi Omar, On Mon, 2019-08-05 at 03:40 -0700, Omar Sandoval wrote: > From: Omar Sandoval > > dwfl_segment_report_module() (used only by dwfl_core_file_report()) > opens a file descriptor and/or an Elf handle, reports a module, and > assigns mod->main.elf. However, it doesn't assign mod->main.fd, s

[PATCH] libdwfl: Fix fd leak/closing wrong fd after dwfl_core_file_report()

2019-08-05 Thread Omar Sandoval
From: Omar Sandoval dwfl_segment_report_module() (used only by dwfl_core_file_report()) opens a file descriptor and/or an Elf handle, reports a module, and assigns mod->main.elf. However, it doesn't assign mod->main.fd, so it is left as 0. This causes two problems: 1. We leak the file descriptor