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 05/40] fix cleanup buglet in ada-lang.c


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


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