mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-19 09:14:14 +08:00
Fix cli_interp::cli_uiout resource leak found by Coverity
This commit fixes a resource leak found by Coverity, where cli_interp's constructor creates a new cli_ui_out, but there was no corresponding destructor to free it. gdb/ChangeLog: * cli/cli-interp.c (cli_interp::~cli_interp): New function.
This commit is contained in:
@ -1,3 +1,7 @@
|
|||||||
|
2018-10-19 Gary Benson <gbenson@redhat.com>
|
||||||
|
|
||||||
|
* cli/cli-interp.c (cli_interp::~cli_interp): New function.
|
||||||
|
|
||||||
2018-10-18 Sergio Durigan Junior <sergiodj@redhat.com>
|
2018-10-18 Sergio Durigan Junior <sergiodj@redhat.com>
|
||||||
|
|
||||||
PR cli/23785
|
PR cli/23785
|
||||||
|
@ -44,6 +44,7 @@ class cli_interp final : public cli_interp_base
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit cli_interp (const char *name);
|
explicit cli_interp (const char *name);
|
||||||
|
~cli_interp ();
|
||||||
|
|
||||||
void init (bool top_level) override;
|
void init (bool top_level) override;
|
||||||
void resume () override;
|
void resume () override;
|
||||||
@ -62,6 +63,11 @@ cli_interp::cli_interp (const char *name)
|
|||||||
this->cli_uiout = cli_out_new (gdb_stdout);
|
this->cli_uiout = cli_out_new (gdb_stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cli_interp::~cli_interp ()
|
||||||
|
{
|
||||||
|
delete cli_uiout;
|
||||||
|
}
|
||||||
|
|
||||||
/* Suppress notification struct. */
|
/* Suppress notification struct. */
|
||||||
struct cli_suppress_notification cli_suppress_notification =
|
struct cli_suppress_notification cli_suppress_notification =
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user