From 7abe9c44f5c0c272aa4f9443d830bce0eae0becb Mon Sep 17 00:00:00 2001 From: Eric Koegel Date: Wed, 3 Dec 2014 18:26:02 +0300 Subject: [PATCH] Fix for crash when choosing random backdrop (Bug 11346) Instead of trying to be clever with memory management just let xfdesktop filter out the invalid/blank lines. --- common/xfdesktop-common.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/common/xfdesktop-common.c b/common/xfdesktop-common.c index 2b8e80b..987479f 100644 --- a/common/xfdesktop-common.c +++ b/common/xfdesktop-common.c @@ -102,19 +102,9 @@ xfdesktop_backdrop_list_load(const gchar *filename, items = 0; files = g_strsplit(contents, "\n", -1); - /* Since the first line is the file identifier, we need to skip it. - * Additionally, we want to skip blank lines. */ for(i = 1; files[i] != NULL; i++) { - if(g_strcmp0(files[i], "") != 0) { - g_free(files[items]); - files[items] = g_strdup(files[i]); - DBG("files[items] %s", files[items]); items++; - } } - files[items+1] = NULL; - - files = g_realloc(files, sizeof(gchar *) * (items+1)); DBG("items %d", items); if(n_items) -- 2.1.3