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]

[COMMITTED PATCH] completer.c (completion_list_add_name): Fix memory leak.


Hi.

Missed this, bleah.

2015-02-12  Doug Evans  <dje@google.com>

	* completer.c (completion_list_add_name): Fix memory leak.

diff --git a/gdb/symtab.c b/gdb/symtab.c
index 84e2680..5302afa 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -5062,6 +5062,7 @@ completion_list_add_name (const char *symname,
 	VEC_safe_push (char_ptr, return_val, new);
 	throw_max_completions_reached_error ();
       case MAYBE_ADD_COMPLETION_MAX_REACHED:
+	xfree (new);
 	throw_max_completions_reached_error ();
       case MAYBE_ADD_COMPLETION_DUPLICATE:
 	xfree (new);


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