This is the mail archive of the
mailing list for the GDB project.
[darwin/committed] fix invalid free for reload
- From: Tristan Gingold <gingold at adacore dot com>
- To: "gdb-patches at sourceware dot org ml" <gdb-patches at sourceware dot org>
- Date: Wed, 8 Feb 2012 10:17:21 +0100
- Subject: [darwin/committed] fix invalid free for reload
I am checking in a patch from Joel that fixes an invalid free occurring when the BFD of a shared library is free.
2012-02-08 Joel Brobecker <email@example.com>
* solib-darwin.c (darwin_bfd_open): Make sure that the filename
of the returned BFD is allocated by GDB.
RCS file: /cvs/src/src/gdb/solib-darwin.c,v
retrieving revision 1.18
diff -c -r1.18 solib-darwin.c
*** solib-darwin.c 4 Jan 2012 08:17:11 -0000 1.18
--- solib-darwin.c 8 Feb 2012 09:15:49 -0000
*** 456,461 ****
--- 456,467 ----
error (_("`%s': not a shared-library: %s"),
found_pathname, bfd_errmsg (bfd_get_error ()));
+ /* Make sure that the filename is malloc'ed. The current filename
+ for fat-binaries BFDs is a name that was generated by BFD, usually
+ a static string containing the name of the architecture. */
+ res->filename = xstrdup (pathname);