diff options
author | Michael Snyder <msnyder@vmware.com> | 2007-08-17 23:24:18 +0000 |
---|---|---|
committer | Michael Snyder <msnyder@vmware.com> | 2007-08-17 23:24:18 +0000 |
commit | 1f20ed9160677637385a3205c8acd3384ab1cee2 (patch) | |
tree | a57162b1c246271be15667ac2289c1c821a7468c /gdb/completer.c | |
parent | 74dddad306a1f78d799830f4d3dd573d381b6d13 (diff) | |
download | gdb-1f20ed9160677637385a3205c8acd3384ab1cee2.zip gdb-1f20ed9160677637385a3205c8acd3384ab1cee2.tar.gz gdb-1f20ed9160677637385a3205c8acd3384ab1cee2.tar.bz2 |
2007-08-17 Michael Snyder <msnyder@access-company.com>
* completer.c (location_completer): Must free 'fn_list', except
in the one case where it is returned (as 'list').
Diffstat (limited to 'gdb/completer.c')
-rw-r--r-- | gdb/completer.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gdb/completer.c b/gdb/completer.c index 617aa6a..0a0d30e 100644 --- a/gdb/completer.c +++ b/gdb/completer.c @@ -281,7 +281,8 @@ location_completer (char *text, char *word) list = make_symbol_completion_list (symbol_start, word); /* If text includes characters which cannot appear in a file name, they cannot be asking for completion on files. */ - if (strcspn (text, gdb_completer_file_name_break_characters) == text_len) + if (strcspn (text, + gdb_completer_file_name_break_characters) == text_len) fn_list = make_source_files_completion_list (text, text); } @@ -331,7 +332,10 @@ location_completer (char *text, char *word) /* No completions at all. As the final resort, try completing on the entire text as a symbol. */ list = make_symbol_completion_list (orig_text, word); + xfree (fn_list); } + else + xfree (fn_list); return list; } |