From 988b173b138491d3212888a4bc5bcb4eadb911ee Mon Sep 17 00:00:00 2001 From: Tristan Matthews <tristan.matthews@savoirfairelinux.com> Date: Mon, 15 Aug 2011 13:44:34 -0400 Subject: [PATCH] * #6623: fixed leak in history --- gnome/src/contacts/history.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gnome/src/contacts/history.c b/gnome/src/contacts/history.c index 185cfc3760..5aa4ef2880 100644 --- a/gnome/src/contacts/history.c +++ b/gnome/src/contacts/history.c @@ -100,15 +100,17 @@ static gboolean history_is_visible (GtkTreeModel* model, GtkTreeIter* iter, gpoi history_entry = (gpointer) g_value_get_pointer (&obj); } + gboolean result = TRUE; + if (text != NULL) { if (history_entry) { // Filter according to the type of call // MISSED, INCOMING, OUTGOING, ALL if ( (int) get_current_history_search_type () == SEARCH_ALL) - return g_regex_match_simple (search, text, G_REGEX_CASELESS, 0); + result = g_regex_match_simple (search, text, G_REGEX_CASELESS, 0); else { // We need a match on the history_state_t and the current search type - return (history_entry->_history_state + 1) == (guint) get_current_history_search_type () && + result = (history_entry->_history_state + 1) == (guint) get_current_history_search_type () && g_regex_match_simple (search, text, G_REGEX_CASELESS, 0); } } @@ -118,5 +120,5 @@ static gboolean history_is_visible (GtkTreeModel* model, GtkTreeIter* iter, gpoi g_value_unset (&val); g_value_unset (&obj); - return TRUE; + return result; } -- GitLab