public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* binutils/dwarf.c abbrev list leak
@ 2023-08-30  1:54 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2023-08-30  1:54 UTC (permalink / raw)
  To: binutils

	* dwarf.c (process_debug_info): Call free_abrev_list on
	return paths.

diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 80bbc547bb1..9e22a74209e 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -3997,7 +3997,11 @@ process_debug_info (struct dwarf_section * section,
 		    }
 		}
 	      if (dwarf_start_die != 0 && level < saved_level)
-		return true;
+		{
+		  if (list != NULL)
+		    free_abbrev_list (list);
+		  return true;
+		}
 	      continue;
 	    }
 
@@ -4038,6 +4042,8 @@ process_debug_info (struct dwarf_section * section,
 		}
 	      warn (_("DIE at offset %#lx refers to abbreviation number %lu which does not exist\n"),
 		    die_offset, abbrev_number);
+	      if (list != NULL)
+		free_abbrev_list (list);
 	      return false;
 	    }
 

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-08-30  1:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-30  1:54 binutils/dwarf.c abbrev list leak Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).