From 013d031916a1f154054c3b2ccc2d35fa9ff5e397 Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Thu, 12 Feb 2015 13:32:36 -0800 Subject: [PATCH] completer.c (completion_list_add_name): Fix memory leak. gdb/ChangeLog: * completer.c (completion_list_add_name): Fix memory leak. --- gdb/ChangeLog | 4 ++++ gdb/symtab.c | 1 + 2 files changed, 5 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a680f245d73..175328a0fba 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2015-02-12 Doug Evans + + * completer.c (completion_list_add_name): Fix memory leak. + 2015-02-12 Doug Evans * completer.c (complete_line): Remove incorrect comment. diff --git a/gdb/symtab.c b/gdb/symtab.c index 84e268087ae..5302afaa5fb 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); -- 2.30.2