From b9b5d6a5f849346497f8fc89fff977a5edd352e9 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 15 Jun 2014 17:32:30 +0100 Subject: [PATCH] Fixed memleak in autocompleter --- prof.supp | 11 +++++++++++ src/tools/autocomplete.c | 3 +++ 2 files changed, 14 insertions(+) diff --git a/prof.supp b/prof.supp index bfc4bf38..8a33cdbf 100644 --- a/prof.supp +++ b/prof.supp @@ -6,3 +6,14 @@ obj:/lib/x86_64-linux-gnu/ld-2.17.so ... } + +{ + otrl_init + Memcheck:Leak + ... + fun:_otr_init + fun:_init + fun:prof_run + ... +} + diff --git a/src/tools/autocomplete.c b/src/tools/autocomplete.c index f6d57e23..7aaf2ab5 100644 --- a/src/tools/autocomplete.c +++ b/src/tools/autocomplete.c @@ -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;