aboutsummaryrefslogtreecommitdiff
path: root/gdb/auto-load.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-02-08 12:08:58 -0700
committerTom Tromey <tom@tromey.com>2018-02-09 05:53:22 -0700
commit869e8290ea62f594d2472476303bb74604e9326b (patch)
treecb35128713a4493b33840ad0bea8ca6275a702e1 /gdb/auto-load.c
parenta37a2ae7080898244de86d136961de81fe28a434 (diff)
downloadgdb-869e8290ea62f594d2472476303bb74604e9326b.zip
gdb-869e8290ea62f594d2472476303bb74604e9326b.tar.gz
gdb-869e8290ea62f594d2472476303bb74604e9326b.tar.bz2
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.
Diffstat (limited to 'gdb/auto-load.c')
-rw-r--r--gdb/auto-load.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/gdb/auto-load.c b/gdb/auto-load.c
index 1f3d366..b79341f 100644
--- a/gdb/auto-load.c
+++ b/gdb/auto-load.c
@@ -1153,13 +1153,11 @@ auto_load_section_scripts (struct objfile *objfile, const char *section_name)
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);
}
}