mmo tdata leak

Message ID 20200104085335.GT16749@bubble.grove.modra.org
State New
Headers show
Series
  • mmo tdata leak
Related show

Commit Message

Alan Modra Jan. 4, 2020, 8:53 a.m.
malloc'd tdata isn't freed.

	* mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.


-- 
Alan Modra
Australia Development Lab, IBM

Patch

diff --git a/bfd/mmo.c b/bfd/mmo.c
index ca116aa42f..9ac689d042 100644
--- a/bfd/mmo.c
+++ b/bfd/mmo.c
@@ -579,7 +579,7 @@  mmo_mkobject (bfd *abfd)
 
       /* All fields are zero-initialized, so we don't have to explicitly
 	 initialize most.  */
-      tdata_type *tdata = (tdata_type *) bfd_zmalloc (sizeof (tdata_type));
+      tdata_type *tdata = (tdata_type *) bfd_zalloc (abfd, sizeof (tdata_type));
       if (tdata == NULL)
 	return FALSE;