This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 05/40] fix cleanup buglet in ada-lang.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:49:25 -0600
- Subject: [PATCH 05/40] fix cleanup buglet in ada-lang.c
- References: <cover dot 1368124285 dot git dot tromey at redhat dot com>
This fixes ada_make_symbol_completion_list not to leak cleanups.
* ada-lang.c (ada_make_symbol_completion_list): Call do_cleanups.
---
gdb/ada-lang.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 3510750..314f4ca 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -5841,6 +5841,7 @@ ada_make_symbol_completion_list (const char *text0, const char *word,
struct block *b, *surrounding_static_block = 0;
int i;
struct block_iterator iter;
+ struct cleanup *cleanup = make_cleanup (null_cleanup, NULL);
gdb_assert (code == TYPE_CODE_UNDEF);
@@ -5941,6 +5942,7 @@ ada_make_symbol_completion_list (const char *text0, const char *word,
}
}
+ do_cleanups (cleanup);
return completions;
}
--
1.8.1.4