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]

Re: [PATCH] Fix copy of filename in bfd's filename field


Hi Edjunior,


gdb/
2014-01-03  Edjunior Barbosa Machado  <emachado@linux.vnet.ibm.com>

	* gdb_bfd.c (gdb_bfd_stash_filename): Fix copy of filename in bfd's
	filename field using xstrdup.


@@ -69,7 +69,7 @@ gdb_bfd_stash_filename (struct bfd *abfd)
    strcpy (data, name);

    /* Unwarranted chumminess with BFD.  */
-  abfd->filename = data;
+  abfd->filename = xstrdup (data);
  }

  /* An object of this type is stored in each BFD's user data.  */

It might be nice to remove the comment too. :-)

Cheers
  Nick



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