Fixed memleak in autocompleter

This commit is contained in:
James Booth
2014-06-15 17:32:30 +01:00
parent e296379863
commit b9b5d6a5f8
2 changed files with 14 additions and 0 deletions

View File

@@ -162,6 +162,9 @@ autocomplete_complete(Autocomplete ac, gchar *search_str)
// first search attempt
if (ac->last_found == NULL) {
if (ac->search_str != NULL) {
FREE_SET_NULL(ac->search_str);
}
ac->search_str = strdup(search_str);
found = _search_from(ac, ac->items);
return found;