]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
libctf: actually close bfds we have opened
authorNick Alcock <nick.alcock@oracle.com>
Mon, 29 Jul 2019 16:02:48 +0000 (17:02 +0100)
committerNick Alcock <nick.alcock@oracle.com>
Mon, 23 Sep 2019 13:12:54 +0000 (14:12 +0100)
commitbf05b84eda6ea5e903ed19fad4e509eca43a7267
tree236e0f2df8302b33392eec6ada6b423fbf54fad3
parentfba72c8c05c56493fc78a4328b4969b9f136ee0c
libctf: actually close bfds we have opened

When we do a ctf_fdopen, we open things via bfd_fdopenr and set up a
hook to close the bfd again... but then we never actually call that hook
from anywhere, so we eventually leak every bfd we open.

Fix this by calling the hook (if set) in ctf_arc_close.

New in v3.

libctf/
* ctf-archive.c (ctf_arc_close): Call ctfi_bfd_close if set.
* ctf-open-bfd.c (ctf_bfdclose): Fix comment.
libctf/ChangeLog
libctf/ctf-archive.c
libctf/ctf-open-bfd.c