[PATCH 05/40] fix cleanup buglet in ada-lang.c

Tom Tromey
2013-05-09T18:49:29Z

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