This changes auto_load_section_scripts to use gdb::unique_xmalloc_ptr,
allowing the removal of a cleanup.
2018-02-09 Tom Tromey <tom@tromey.com>
* auto-load.c (auto_load_section_scripts): Use
gdb::unique_xmalloc_ptr.
+2018-02-09 Tom Tromey <tom@tromey.com>
+
+ * auto-load.c (auto_load_section_scripts): Use
+ gdb::unique_xmalloc_ptr.
+
2018-02-09 Tom Tromey <tom@tromey.com>
* auto-load.c (execute_script_contents): Use std::string.
section_name, bfd_get_filename (abfd));
else
{
- struct cleanup *cleanups;
- char *p = (char *) data;
+ gdb::unique_xmalloc_ptr<bfd_byte> data_holder (data);
- cleanups = make_cleanup (xfree, p);
+ char *p = (char *) data;
source_section_scripts (objfile, section_name, p,
p + bfd_get_section_size (scripts_sect));
- do_cleanups (cleanups);
}
}