debuginfod: Fix debuginfod_pool leak
Commit Message
gcc address sanitizer detected a dangling debuginfod_client handler
when debuginfod exits. Make sure to groom the debuginfod client pool
before exit after all threads are done.
Signed-off-by: Mark Wielaard <mark@klomp.org>
---
debuginfod/ChangeLog | 4 ++++
debuginfod/debuginfod.cxx | 2 ++
2 files changed, 6 insertions(+)
Comments
On Sat, Dec 04, 2021 at 10:33:35PM +0100, Mark Wielaard wrote:
> gcc address sanitizer detected a dangling debuginfod_client handler
> when debuginfod exits. Make sure to groom the debuginfod client pool
> before exit after all threads are done.
Pushed,
Mark
@@ -1,3 +1,7 @@
+2021-12-04 Mark Wielaard <mark@klomp.org>
+
+ * debuginfod.cxx (main): Call debuginfod_pool_groom before exit.
+
2021-11-10 Érico N. Rolim <erico.erc@gmail.com>
* debuginfod.cxx: include "system.h" under 'extern "C"' block.
@@ -3994,6 +3994,8 @@ main (int argc, char *argv[])
}
}
+ debuginfod_pool_groom ();
+
// NB: no problem with unconditional free here - an earlier failed regcomp would exit program
(void) regfree (& file_include_regex);
(void) regfree (& file_exclude_regex);