+2014-06-25 Markus Metzger <markus.t.metzger@intel.com>
+
+ * fbsd-nat.c (fbsd_make_corefile_notes): Remove make_cleanup call.
+ * gcore.c (write_gcore_file): Free memory returned from
+ make_corefile_notes.
+ * linux-tdep.c (linux_make_corefile_notes): Remove make_cleanup call.
+ * procfs.c (procfs_make_note_section): Remove make_cleanup call.
+
2014-06-24 Yao Qi <yao@codesourcery.com>
* arm-linux-tdep.c (arm_linux_skip_trampoline_code): New.
void
write_gcore_file (bfd *obfd)
{
+ struct cleanup *cleanup;
void *note_data = NULL;
int note_size = 0;
asection *note_sec = NULL;
else
note_data = gdbarch_make_corefile_notes (target_gdbarch (), obfd, ¬e_size);
+ cleanup = make_cleanup (xfree, note_data);
+
if (note_data == NULL || note_size == 0)
error (_("Target does not support core file generation."));
/* Write out the contents of the note section. */
if (!bfd_set_section_contents (obfd, note_sec, note_data, 0, note_size))
warning (_("writing note section (%s)"), bfd_errmsg (bfd_get_error ()));
+
+ do_cleanups (cleanup);
}
static void
note_data = linux_make_mappings_corefile_notes (gdbarch, obfd,
note_data, note_size);
- make_cleanup (xfree, note_data);
return note_data;
}