Use gdb::unique_xmalloc_ptr in auto_load_section_scripts
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.
This commit is contained in:
parent
a37a2ae708
commit
869e8290ea
2 changed files with 7 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
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>
|
2018-02-09 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
* auto-load.c (execute_script_contents): Use std::string.
|
* auto-load.c (execute_script_contents): Use std::string.
|
||||||
|
|
|
@ -1153,13 +1153,11 @@ auto_load_section_scripts (struct objfile *objfile, const char *section_name)
|
||||||
section_name, bfd_get_filename (abfd));
|
section_name, bfd_get_filename (abfd));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
struct cleanup *cleanups;
|
gdb::unique_xmalloc_ptr<bfd_byte> data_holder (data);
|
||||||
char *p = (char *) data;
|
|
||||||
|
|
||||||
cleanups = make_cleanup (xfree, p);
|
char *p = (char *) data;
|
||||||
source_section_scripts (objfile, section_name, p,
|
source_section_scripts (objfile, section_name, p,
|
||||||
p + bfd_get_section_size (scripts_sect));
|
p + bfd_get_section_size (scripts_sect));
|
||||||
do_cleanups (cleanups);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue