summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Alan Fitton <ajf@eth0.org.uk>2011-12-12 23:23:05 +0000
committerGravatar Alan Fitton <ajf@eth0.org.uk>2011-12-12 23:23:05 +0000
commit88c6ea726067a1426cf03488276b4031c92a840a (patch)
tree745bcdf35cecacb1b871a613b4ec89acd19160e4 /src
parentc8240fd86272a628ef20e6947dde0f53620f33e5 (diff)
a memory leak when filtering by tracker
Diffstat (limited to 'src')
-rw-r--r--src/trg-main-window.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/trg-main-window.c b/src/trg-main-window.c
index 8c93c7c..4d403a8 100644
--- a/src/trg-main-window.c
+++ b/src/trg-main-window.c
@@ -1252,13 +1252,15 @@ static gboolean trg_torrent_tree_view_visible_func(GtkTreeModel * model,
if (criteria & FILTER_FLAG_TRACKER) {
gchar *text =
trg_state_selector_get_selected_text(priv->stateSelector);
- JsonObject *json;
+ JsonObject *json = NULL;
+ gboolean matchesTracker;
gtk_tree_model_get(model, iter, TORRENT_COLUMN_JSON, &json,
-1);
-
- if (!json || !torrent_has_tracker(json,
+ matchesTracker = (!json || !torrent_has_tracker(json,
trg_state_selector_get_url_host_regex
- (priv->stateSelector), text))
+ (priv->stateSelector), text));
+ g_free(text);
+ if (matchesTracker)
return FALSE;
} else if (criteria & FILTER_FLAG_DIR) {
gchar *text =