From f24bdec48621f419fdc9dcd58f46891f062b7bc0 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 31 Dec 2019 08:55:08 +1030 Subject: [PATCH] mmo tdata leak malloc'd tdata isn't freed. * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc. --- bfd/ChangeLog | 4 ++++ bfd/mmo.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 6d19839fec..8291a980f4 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,7 @@ +2020-01-04 Alan Modra + + * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc. + 2020-01-04 Alan Modra * coffgen.c (coff_real_object_p): Free malloc'd memory on target 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; -- 2.34.1