This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI: fix BFD leak


I'm checking this in.

An earlier patch introduced a BFD leak by accident.

I found this thanks to playing with "maint info bfd".

Tom

	* symfile.c (symbol_file_add): Don't open BFD twice.
---
 gdb/symfile.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/gdb/symfile.c b/gdb/symfile.c
index 7a913e9..95ed480 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -1208,8 +1208,7 @@ symbol_file_add (char *name, int add_flags, struct section_addr_info *addrs,
   struct cleanup *cleanup = make_cleanup_bfd_unref (bfd);
   struct objfile *objf;
 
-  objf = symbol_file_add_from_bfd (symfile_bfd_open (name), add_flags, addrs,
-                                   flags, NULL);
+  objf = symbol_file_add_from_bfd (bfd, add_flags, addrs, flags, NULL);
   do_cleanups (cleanup);
   return objf;
 }
-- 
1.7.7.6


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]