• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

修訂bf05b84eda6ea5e903ed19fad4e509eca43a7267 (tree)
時間2019-09-23 22:12:54
作者Nick Alcock <nick.alcock@orac...>
CommiterNick Alcock

Log Message

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.

Change Summary

差異

--- a/libctf/ChangeLog
+++ b/libctf/ChangeLog
@@ -1,5 +1,10 @@
11 2019-07-30 Nick Alcock <nick.alcock@oracle.com>
22
3+ * ctf-archive.c (ctf_arc_close): Call ctfi_bfd_close if set.
4+ * ctf-open-bfd.c (ctf_bfdclose): Fix comment.
5+
6+2019-07-30 Nick Alcock <nick.alcock@oracle.com>
7+
38 * ctf-open-bfd.c (ctf_fdopen): Call bfd_set_cacheable.
49
510 2019-07-13 Nick Alcock <nick.alcock@oracle.com>
--- a/libctf/ctf-archive.c
+++ b/libctf/ctf-archive.c
@@ -436,6 +436,8 @@ ctf_arc_close (ctf_archive_t *arc)
436436 free ((void *) arc->ctfi_symsect.cts_data);
437437 /* Do not free the ctfi_strsect: it is bound to the bfd. */
438438 free (arc->ctfi_data);
439+ if (arc->ctfi_bfd_close)
440+ arc->ctfi_bfd_close (arc);
439441 free (arc);
440442 }
441443
--- a/libctf/ctf-open-bfd.c
+++ b/libctf/ctf-open-bfd.c
@@ -66,7 +66,7 @@ ctf_new_archive_internal (int is_archive, struct ctf_archive *arc,
6666 return arci;
6767 }
6868
69-/* Free the BFD bits of a CTF file on ctf_file_close(). */
69+/* Free the BFD bits of a CTF file on ctf_arc_close(). */
7070
7171 static void
7272 ctf_bfdclose (struct ctf_archive_internal *arci)