[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug binutils/22032] Memory leak in bfd_close_all_done
From: |
cvs-commit at gcc dot gnu.org |
Subject: |
[Bug binutils/22032] Memory leak in bfd_close_all_done |
Date: |
Thu, 31 Aug 2017 01:01:21 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=22032
--- Comment #3 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot
gnu.org> ---
The master branch has been updated by Alan Modra <address@hidden>:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e234de6be5cc96286e0efb90e8d9fce51239e901
commit e234de6be5cc96286e0efb90e8d9fce51239e901
Author: Alan Modra <address@hidden>
Date: Thu Aug 31 08:46:47 2017 +0930
bfd_close_all_done calling _close_and_cleanup
elf64_vms_close_and_cleanup calls bfd_get_size, which calls
iovec->bstat. cache_bstat ends up adding the bfd to the cache lru
list, negating the bfd_cache_close call in bfd_close_all_done. So
there is a dangling pointer into the freed and then reused bfd. Thus,
bfd_cache_close must be called after _close_and_cleanup, or better,
via iovec->bclose.
PR binutils/22032
* opncls.c (bfd_close_all_done): Don't call bfd_cache_close
before _close_and_cleanup. Call iovec->bclose after.
(bfd_close): Remove code common to, and call, bfd_close_all_done.
--
You are receiving this mail because:
You are on the CC list for the bug.