diff options
author | Alan Modra <amodra@gmail.com> | 2019-12-31 08:55:08 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-01-04 19:20:33 +1030 |
commit | f24bdec48621f419fdc9dcd58f46891f062b7bc0 (patch) | |
tree | ccd644383ecc4a9409084ceac8690776384d5ed1 | |
parent | c9ae58fe32e88914b67988d5bfde184f79c7070f (diff) | |
download | gdb-f24bdec48621f419fdc9dcd58f46891f062b7bc0.zip gdb-f24bdec48621f419fdc9dcd58f46891f062b7bc0.tar.gz gdb-f24bdec48621f419fdc9dcd58f46891f062b7bc0.tar.bz2 |
mmo tdata leak
malloc'd tdata isn't freed.
* mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
-rw-r--r-- | bfd/ChangeLog | 4 | ||||
-rw-r--r-- | bfd/mmo.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 6d19839..8291a98 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,9 @@ 2020-01-04 Alan Modra <amodra@gmail.com> + * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc. + +2020-01-04 Alan Modra <amodra@gmail.com> + * coffgen.c (coff_real_object_p): Free malloc'd memory on target match too. @@ -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; |