mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 09:08:59 +00:00
* jit.c (jit_object_close_impl): Don't malloc the objfile
name. * objfiles.c (allocate_objfile): Don't malloc the objfile name. (free_objfile): Don't free the objfile name. * objfiles.h (struct objfile) <name>: Update comment. * symfile.c (reread_symbols): Fix reference counting. Don't malloc objfile name.
This commit is contained in:
@@ -271,7 +271,7 @@ allocate_objfile (bfd *abfd, int flags)
|
||||
/* Look up the gdbarch associated with the BFD. */
|
||||
objfile->gdbarch = gdbarch_from_bfd (abfd);
|
||||
|
||||
objfile->name = xstrdup (bfd_get_filename (abfd));
|
||||
objfile->name = bfd_get_filename (abfd);
|
||||
objfile->mtime = bfd_get_mtime (abfd);
|
||||
|
||||
/* Build section table. */
|
||||
@@ -279,7 +279,7 @@ allocate_objfile (bfd *abfd, int flags)
|
||||
}
|
||||
else
|
||||
{
|
||||
objfile->name = xstrdup ("<<anonymous objfile>>");
|
||||
objfile->name = "<<anonymous objfile>>";
|
||||
}
|
||||
|
||||
objfile->per_bfd = get_objfile_bfd_data (objfile, abfd);
|
||||
@@ -670,7 +670,6 @@ free_objfile (struct objfile *objfile)
|
||||
|
||||
/* The last thing we do is free the objfile struct itself. */
|
||||
|
||||
xfree (objfile->name);
|
||||
if (objfile->global_psymbols.list)
|
||||
xfree (objfile->global_psymbols.list);
|
||||
if (objfile->static_psymbols.list)
|
||||
|
||||
Reference in New Issue
Block a user