Free gas/dwarf2dbg.c dirs

Message ID Y9L2WRS5mIZy8y43@squeak.grove.modra.org
State Unresolved
Headers
Series Free gas/dwarf2dbg.c dirs |

Checks

Context Check Description
snail/binutils-gdb-check warning Git am fail log

Commit Message

Alan Modra Jan. 26, 2023, 9:53 p.m. UTC
  Entries are allocated with xmemdup0.

	* dwarf2dbg.c (dwarf2_cleanup): Free dirs entries.
  

Patch

diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c
index 5f2f58ff7b0..c7d9e8ef72f 100644
--- a/gas/dwarf2dbg.c
+++ b/gas/dwarf2dbg.c
@@ -3096,6 +3096,8 @@  dwarf2_cleanup (void)
 {
   purge_generated_debug (true);
   free (files);
+  for (unsigned int i = 0; i < dirs_in_use; i++)
+    free (dirs[i]);
   free (dirs);
 }