From: Mark Wielaard Date: Sat, 3 Apr 2021 17:36:12 +0000 (+0200) Subject: unstrip: Fix small leak in handle_output_dir_module. X-Git-Tag: elfutils-0.184~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1261691accb3f224ebbaef438a641273c4c3c49f;p=thirdparty%2Felfutils.git 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 --- diff --git a/src/ChangeLog b/src/ChangeLog index f0eee7a8a..300deb4f8 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 f7742ebd0..e488e8107 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); }