From a115d3d11b187034a5f8be1bf151a770d57c37eb Mon Sep 17 00:00:00 2001 From: Alan Fitton Date: Tue, 3 May 2011 16:28:09 +0000 Subject: fix a leak in the last commit --- src/trg-main-window.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/trg-main-window.c') diff --git a/src/trg-main-window.c b/src/trg-main-window.c index be679ee..cc2d13e 100644 --- a/src/trg-main-window.c +++ b/src/trg-main-window.c @@ -1060,17 +1060,19 @@ trg_torrent_tree_view_visible_func(GtkTreeModel * model, gtk_tree_model_get(model, iter, TORRENT_COLUMN_NAME, &name, -1); filterText = gtk_entry_get_text(GTK_ENTRY(priv->filterEntry)); - if (strlen(filterText) > 0 && name) { - gchar *filterCmp = g_utf8_casefold(filterText, -1); - gchar *nameCmp = g_utf8_casefold(name, -1); + if (name) { + if (strlen(filterText) > 0) { + gchar *filterCmp = g_utf8_casefold(filterText, -1); + gchar *nameCmp = g_utf8_casefold(name, -1); - if (!strstr(nameCmp, filterCmp)) - visible = FALSE; + if (!strstr(nameCmp, filterCmp)) + visible = FALSE; - g_free(nameCmp); - g_free(filterCmp); + g_free(nameCmp); + g_free(filterCmp); + } + g_free(name); } - g_free(name); return visible; } -- cgit v1.2.3