aboutsummaryrefslogtreecommitdiff
path: root/gdb/interps.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2022-06-17 09:31:44 -0600
committerTom Tromey <tromey@adacore.com>2022-06-22 13:28:55 -0600
commit3af607d998587de460b9e29996b1d43fa40a76b0 (patch)
treec935f7fb5201489144362f33510540d4d5983407 /gdb/interps.c
parent90b7a5df152a64d2bea20beb438e8b81049a5c30 (diff)
downloadgdb-3af607d998587de460b9e29996b1d43fa40a76b0.zip
gdb-3af607d998587de460b9e29996b1d43fa40a76b0.tar.gz
gdb-3af607d998587de460b9e29996b1d43fa40a76b0.tar.bz2
Use unique_xmalloc_ptr in interp
This changes interp::m_name to be a unique_xmalloc_ptr, removing some manual memory management. It also cleans up the initialization of the 'inited' member, and moves the 'private:' and 'public:' keywords to their proper spots.
Diffstat (limited to 'gdb/interps.c')
-rw-r--r--gdb/interps.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/gdb/interps.c b/gdb/interps.c
index 44002ff..0c440e7 100644
--- a/gdb/interps.c
+++ b/gdb/interps.c
@@ -79,14 +79,12 @@ static struct interp *interp_lookup_existing (struct ui *ui,
const char *name);
interp::interp (const char *name)
- : m_name (xstrdup (name))
+ : m_name (make_unique_xstrdup (name))
{
- this->inited = false;
}
interp::~interp ()
{
- xfree (m_name);
}
/* An interpreter factory. Maps an interpreter name to the factory