* memory leak in objdump disassemble_section
@ 2024-02-07 12:14 Alan Modra
0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2024-02-07 12:14 UTC (permalink / raw)
To: binutils
* objdump.c (disassemble_section): Free rel_ppstart on error path.
diff --git a/binutils/objdump.c b/binutils/objdump.c
index 49e944b1dfd..7beb221cb2f 100644
--- a/binutils/objdump.c
+++ b/binutils/objdump.c
@@ -3795,6 +3795,7 @@ disassemble_section (bfd *abfd, asection *section, void *inf)
{
non_fatal (_("Reading section %s failed because: %s"),
section->name, bfd_errmsg (bfd_get_error ()));
+ free (rel_ppstart);
return;
}
@@ -4075,9 +4076,7 @@ disassemble_section (bfd *abfd, asection *section, void *inf)
}
free (data);
-
- if (rel_ppstart != NULL)
- free (rel_ppstart);
+ free (rel_ppstart);
}
/* Disassemble the contents of an object file. */
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-02-07 12:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-07 12:14 memory leak in objdump disassemble_section 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).