This is the mail archive of the gdb-prs@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]

[Bug gdb/14290] gdb_bfd_unref frees an already freed memory block


http://sourceware.org/bugzilla/show_bug.cgi?id=14290

--- Comment #10 from Tom Tromey <tromey at redhat dot com> 2012-11-27 17:46:09 UTC ---
(In reply to comment #9)
> The patch works for me (I applied it on top of the latest trunk).
> 
> One question: on line 94 of the patch, is it necessary to call gdb_bfd_ref on
> `result`?  In this case, bfd_mach_o_fat_extract was basically a noop, and
> `abfd` was already reference counted by solib_bfd_open.

Thanks for the note -- you are right, the current patch is funny here.
My intent was for gdb_bfd_mach_o_fat_extract to always return a new
reference so that the result could be handled uniformly in all cases.
However I forgot a decref in darwin_bfd_open.
I'll upload a new patch that fixes this.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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