diff options
author | Andrew Burgess <aburgess@redhat.com> | 2021-11-08 14:58:46 +0000 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2021-11-16 17:45:45 +0000 |
commit | 8579fd136a614985bd27f20539c7bb7c5a51287d (patch) | |
tree | fb84850409a44e13e832cbadc9025d40c1d33d9f /gdb/rust-lang.h | |
parent | 2bb7589ddf61e163f2e414e7033fad56ea17e784 (diff) | |
download | binutils-8579fd136a614985bd27f20539c7bb7c5a51287d.zip binutils-8579fd136a614985bd27f20539c7bb7c5a51287d.tar.gz binutils-8579fd136a614985bd27f20539c7bb7c5a51287d.tar.bz2 |
gdb/gdbsupport: make xstrprintf and xstrvprintf return a unique_ptr
The motivation is to reduce the number of places where unmanaged
pointers are returned from allocation type routines. All of the
callers are updated.
There should be no user visible changes after this commit.
Diffstat (limited to 'gdb/rust-lang.h')
-rw-r--r-- | gdb/rust-lang.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gdb/rust-lang.h b/gdb/rust-lang.h index 6962f45..06de60f 100644 --- a/gdb/rust-lang.h +++ b/gdb/rust-lang.h @@ -113,9 +113,8 @@ public: { type = check_typedef (TYPE_TARGET_TYPE (check_typedef (type))); std::string name = type_to_string (type); - return gdb::unique_xmalloc_ptr<char> - (xstrprintf ("*(%s as *mut %s)", core_addr_to_string (addr), - name.c_str ())); + return xstrprintf ("*(%s as *mut %s)", core_addr_to_string (addr), + name.c_str ()); } /* See language.h. */ |