Fix BFD leak in solib-darwin.c
authorTom Tromey <tromey@adacore.com>
Thu, 21 Feb 2019 17:40:49 +0000 (10:40 -0700)
committerTom Tromey <tromey@adacore.com>
Mon, 25 Feb 2019 13:55:02 +0000 (06:55 -0700)
commitcd5a152cebb201e98f3dbeca510aa39e838a1f62
tree89c5978b8bd4d73a09ba27e2fbc5c69dd7a58ff1
parent39f0547e554df96608dd041d2a7b3c72882fd515
Fix BFD leak in solib-darwin.c

commit 192b62ce0b4bb5c61188f570e127a26d2c32f716 ("Use class to manage
BFD reference counts") changed darwin_get_dyld_bfd to use:

+ dyld_bfd.release ();

rather than

-      do_cleanups (cleanup);

However, using release here leaks the BFD.  Instead, simply assigning
"sub" to "dyld_bfd" achieves what was meant.

gdb/ChangeLog
2019-02-25  Tom Tromey  <tromey@adacore.com>

* solib-darwin.c (darwin_get_dyld_bfd): Don't release dyld_bfd.
gdb/ChangeLog
gdb/solib-darwin.c