diff options
author | John Baldwin <jhb@FreeBSD.org> | 2019-02-25 14:25:01 -0800 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2019-02-25 14:25:01 -0800 |
commit | 0f58c9e88ebee636206b946b00ea52b47056b320 (patch) | |
tree | 11bb08dcbd981f5766b74029951e2d1cf573755a /gdb/dwarf2read.c | |
parent | 0a0f4c0179106ee4b8e56649c549f4175ebba994 (diff) | |
download | gdb-0f58c9e88ebee636206b946b00ea52b47056b320.zip gdb-0f58c9e88ebee636206b946b00ea52b47056b320.tar.gz gdb-0f58c9e88ebee636206b946b00ea52b47056b320.tar.bz2 |
Fix BFD leak in dwarf2_get_dwz_file.
Previously if build_id_verify failed, dwz_bfd was cleared to NULL via
release(), but the BFD object was not destroyed. Use reset() with
nullptr instead to delete the BFD.
gdb/ChangeLog:
* dwarf2read.c (dwarf2_get_dwz_file): Reset dwz_bfd to nullptr
instead of releasing ownership.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r-- | gdb/dwarf2read.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 2908a23..2d6cb35 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -2722,7 +2722,7 @@ dwarf2_get_dwz_file (struct dwarf2_per_objfile *dwarf2_per_objfile) if (dwz_bfd != NULL) { if (!build_id_verify (dwz_bfd.get (), buildid_len, buildid)) - dwz_bfd.release (); + dwz_bfd.reset (nullptr); } if (dwz_bfd == NULL) |