]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
unstrip: Fix small leak in handle_output_dir_module.
authorMark Wielaard <mark@klomp.org>
Sat, 3 Apr 2021 17:36:12 +0000 (19:36 +0200)
committerMark Wielaard <mark@klomp.org>
Tue, 13 Apr 2021 12:45:34 +0000 (14:45 +0200)
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 <mark@klomp.org>
src/ChangeLog
src/unstrip.c

index f0eee7a8a5e52a69aec1e9ad9c0a7e2119509cae..300deb4f866e278d3361c56bcf5d43cbd5bbe00e 100644 (file)
@@ -1,3 +1,7 @@
+2021-04-03  Mark Wielaard  <mark@klomp.org>
+
+       * unstrip.c (handle_output_dir_module): Free output_file when done.
+
 2021-04-03  Mark Wielaard  <mark@klomp.org>
 
        * ar.c (do_oper_insert): Always close newfd.
index f7742ebd0016711a47a92ec5c27c31f3066daa68..e488e810722ed9ba384f905299fefa5dc7801ee6 100644 (file)
@@ -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);
 }