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 a680f245d739bf7b12205c5ba547526da133d74f..175328a0fba7738b239ba9c67f9d9f733ef63d48 100644 (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.
index 84e268087aea08d00cd2beb804371dc7afe9b115..5302afaa5fb8f270748d497eeaded3c9973c9a8b 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);