completer.c (completion_list_add_name): Fix memory leak.
authorDoug Evans <dje@google.com>
Thu, 12 Feb 2015 21:32:36 +0000 (13:32 -0800)
committerDoug Evans <dje@google.com>
Thu, 12 Feb 2015 21:32:36 +0000 (13:32 -0800)
gdb/ChangeLog:

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

gdb/ChangeLog
gdb/symtab.c

index a680f24..175328a 100644 (file)
@@ -1,5 +1,9 @@
 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.
 
 2015-02-11  Jan Kratochvil  <jan.kratochvil@redhat.com>
index 84e2680..5302afa 100644 (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);