This commit fixes a resource leak found by Coverity, where interp's
constructor allocated memory for m_name that interp's destructor did
not free.
gdb/ChangeLog:
* interps.h (interp::m_name): Make private and mutable.
* interps.c (interp::~interp): Free m_name.
+2018-10-11 Gary Benson <gbenson@redhat.com>
+
+ * interps.h (interp::m_name): Make private and mutable.
+ * interps.c (interp::~interp): Free m_name.
+
2018-10-10 Sergio Durigan Junior <sergiodj@redhat.com>
Simon Marchi <simark@simark.ca>
2018-10-10 Sergio Durigan Junior <sergiodj@redhat.com>
Simon Marchi <simark@simark.ca>
/* An interpreter factory. Maps an interpreter name to the factory
function that instantiates an interpreter by that name. */
/* An interpreter factory. Maps an interpreter name to the factory
function that instantiates an interpreter by that name. */
}
/* This is the name in "-i=" and "set interpreter". */
}
/* This is the name in "-i=" and "set interpreter". */
+private:
+ char *m_name;
/* Interpreters are stored in a linked list, this is the next
one... */
/* Interpreters are stored in a linked list, this is the next
one... */
struct interp *next;
/* Has the init method been run? */
struct interp *next;
/* Has the init method been run? */