[PATCH] ar: Always close newfd in do_oper_insert.
newfd is normally created by mkstemp given the original fd exists. Otherwise it will created by open from arfname. In the second case newfd might not get closed. Preventd this by always trying to close it after errout. Signed-off-by: Mark Wielaard --- src/ChangeLog | 4 src/ar.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 14cd6cac..f0eee7a8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2021-04-03 Mark Wielaard + + * ar.c (do_oper_insert): Always close newfd. + 2021-03-03 Mark Wielaard * readelf.c (handle_symtab): Sanity check verneed vna_next, diff --git a/src/ar.c b/src/ar.c index 66b2c4fd..ab6098f0 100644 --- a/src/ar.c +++ b/src/ar.c @@ -1566,6 +1566,9 @@ do_oper_insert (int oper, const char *arfname, char **argv, int argc, if (fd != -1) close (fd); + if (newfd != -1) +close (newfd); + return status; } -- 2.18.4
[PATCH] unstrip: Fix small leak in handle_output_dir_module.
eu-unstrip might leak a string for each module found when using the -d option. Make sure to free the output_file name when we are done with the module. Signed-off-by: Mark Wielaard --- src/ChangeLog | 4 src/unstrip.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index f0eee7a8..300deb4f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2021-04-03 Mark Wielaard + + * unstrip.c (handle_output_dir_module): Free output_file when done. + 2021-04-03 Mark Wielaard * ar.c (do_oper_insert): Always close newfd. diff --git a/src/unstrip.c b/src/unstrip.c index f7742ebd..e488e810 100644 --- a/src/unstrip.c +++ b/src/unstrip.c @@ -2404,6 +2404,8 @@ handle_output_dir_module (const char *output_dir, Dwfl_Module *mod, bool force, error (EXIT_FAILURE, 0, _("memory exhausted")); handle_dwfl_module (output_file, true, force, mod, all, ignore, relocate); + + free (output_file); } -- 2.18.4
[PATCH] nm: Fix file descriptor leak on dwfl_begin failure.
If dwfl_begin fails we won't use the dwfl_fd descriptor we just dupped. Make sure to close on dwfl_begin failure to avoid the leak. Signed-off-by: Mark Wielaard --- src/ChangeLog | 4 src/nm.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 300deb4f..0cea28e2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2021-04-03 Mark Wielaard + + * nm.c (show_symbols): close dwfl_fd if dwfl_begin fails. + 2021-04-03 Mark Wielaard * unstrip.c (handle_output_dir_module): Free output_file when done. diff --git a/src/nm.c b/src/nm.c index fb761ef3..dc2186db 100644 --- a/src/nm.c +++ b/src/nm.c @@ -1308,6 +1308,8 @@ show_symbols (int fd, Ebl *ebl, GElf_Ehdr *ehdr, dwfl_getmodules (dwfl, &getdbg_dwflmod, &get, 0); } } + else + close (dwfl_fd); } } if (dbg != NULL) -- 2.18.4
[PATCH] doc/debuginfod.8: fix wrong parameter name for .deb files in description
One place in the description referred to the parameter for .deb/.ddeb files as "-D" as opposed to the correct "-U". Signed-off-by: Andreas Ziegler --- doc/debuginfod.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/debuginfod.8 b/doc/debuginfod.8 index c33a4b6b..1ba42cf6 100644 --- a/doc/debuginfod.8 +++ b/doc/debuginfod.8 @@ -64,7 +64,7 @@ or even use debuginfod itself: If any of the \fB\-R\fP, \fB-U\fP, or \fB-Z\fP options is given, each file is scanned as an archive file that may contain ELF/DWARF/source files. Archive files are recognized by extension. If \-R is given, -".rpm" files are scanned; if \-D is given, ".deb" and ".ddeb" files +".rpm" files are scanned; if \-U is given, ".deb" and ".ddeb" files are scanned; if \-Z is given, the listed extensions are scanned. Because of complications such as DWZ-compressed debuginfo, may require \fItwo\fP traversal passes to identify all source code. Source files -- 2.20.1