This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 26/40] fix top.c


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]