[PATCH 26/40] fix top.c

Tom Tromey
2013-05-09T18:52:03Z

execute_command can leak a cleanup along one return path.

* top.c (execute_command): Discard 'cleanup_if_error' cleanups.
---
gdb/top.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/gdb/top.c b/gdb/top.c
index 480b67e..8ac756f 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -425,6 +425,7 @@ execute_command (char *p, int from_tty)
if (p == NULL)
{
do_cleanups (cleanup);
+ discard_cleanups (cleanup_if_error);
return;
}

--
1.8.1.4