This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 26/40] fix top.c
- From: Tom Tromey <tromey at redhat dot com>
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Thu, 09 May 2013 12:51:58 -0600
- Subject: [PATCH 26/40] fix top.c
- References: <cover dot 1368124285 dot git dot tromey at redhat dot com>
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