This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[COMMITTED PATCH] completer.c (completion_list_add_name): Fix memory leak.
- From: Doug Evans <dje at google dot com>
- To: gdb-patches at sourceware dot org
- Date: Thu, 12 Feb 2015 13:36:16 -0800
- Subject: [COMMITTED PATCH] completer.c (completion_list_add_name): Fix memory leak.
- Authentication-results: sourceware.org; auth=none
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);