completer.c (completion_list_add_name): Fix memory leak.

gdb/ChangeLog:

	* completer.c (completion_list_add_name): Fix memory leak.
This commit is contained in:
Doug Evans 2015-02-12 13:32:36 -08:00
parent fa3f8d5ac6
commit 013d031916
2 changed files with 5 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2015-02-12 Doug Evans <dje@google.com>
* completer.c (completion_list_add_name): Fix memory leak.
2015-02-12 Doug Evans <dje@google.com>
* completer.c (complete_line): Remove incorrect comment.

View File

@ -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);