]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
debuginfod: Fix debuginfod_pool leak
authorMark Wielaard <mark@klomp.org>
Sat, 4 Dec 2021 01:57:24 +0000 (02:57 +0100)
committerMark Wielaard <mark@klomp.org>
Wed, 8 Dec 2021 23:19:49 +0000 (00:19 +0100)
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
debuginfod/debuginfod.cxx

index 0ced287742a8825926c0e9ade31dc3c9a19d2d48..7a4840ff6c149997f72acfee8ec59be766208e73 100644 (file)
@@ -1,3 +1,7 @@
+2021-12-04  Mark Wielaard  <mark@klomp.org>
+
+       * debuginfod.cxx (main): Call debuginfod_pool_groom before exit.
+
 2021-12-08  Mark Wielaard  <mark@klomp.org>
 
        * debuginfod.cxx (add_mhd_response_header): New function.
index 438e874cd640d3cfa6ae61d5826f244ef5589440..35424e47bc567566e1fb8d6972ebbea09cd0bc4b 100644 (file)
@@ -4021,6 +4021,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);