fix top.c
authorTom Tromey <tromey@redhat.com>
Thu, 30 May 2013 17:27:44 +0000 (17:27 +0000)
committerTom Tromey <tromey@redhat.com>
Thu, 30 May 2013 17:27:44 +0000 (17:27 +0000)
execute_command can leak a cleanup along one return path.

* top.c (execute_command): Discard 'cleanup_if_error' cleanups.

gdb/ChangeLog
gdb/top.c

index 6d51b21..30b2bb0 100644 (file)
@@ -1,5 +1,9 @@
 2013-05-30  Tom Tromey  <tromey@redhat.com>
 
+       * top.c (execute_command): Discard 'cleanup_if_error' cleanups.
+
+2013-05-30  Tom Tromey  <tromey@redhat.com>
+
        * stabsread.c (read_struct_type): Call do_cleanups along
        all return paths.
 
index 480b67e..8ac756f 100644 (file)
--- 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;
     }