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]

[darwin/committed] fix invalid free for reload


Hi,

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  <brobecker@adacore.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);
+ 
    return res;
  }
  


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