summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Elia Argentieri <elia.argentieri@openmailbox.org>2017-07-11 01:17:04 +0200
committerGravatar Alan F <alan@eth0.org.uk>2017-07-14 21:43:43 +0100
commita502e7e30d7f178993a2cc7b19bcfd238162fe2a (patch)
treec4e6d984ceba7453de8a8c70ca5cd70a61770427
parent20a1832618849df958ecf8e6392dd34af02dc850 (diff)
Fix memory leak of g_utf8_strdown
-rw-r--r--src/trg-files-tree-view.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/trg-files-tree-view.c b/src/trg-files-tree-view.c
index 2b739c9..afe6073 100644
--- a/src/trg-files-tree-view.c
+++ b/src/trg-files-tree-view.c
@@ -186,8 +186,14 @@ search_func (GtkTreeModel *model, gint column,
gpointer search_data)
{
gchar *iter_string = NULL;
+ gchar *lowercase = NULL;
+ gboolean result = TRUE;
gtk_tree_model_get(model, iter, column, &iter_string, -1);
- gboolean result = g_strrstr(g_utf8_strdown(iter_string, -1), key) == NULL;
+ if (iter_string != NULL) {
+ lowercase = g_utf8_strdown(iter_string, -1);
+ result = g_strrstr(lowercase, key) == NULL;
+ }
+ g_free(lowercase);
g_free(iter_string);
return result;
}