summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eel/eel-background.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/eel/eel-background.c b/eel/eel-background.c
index 8b2adffe..ae585d6a 100644
--- a/eel/eel-background.c
+++ b/eel/eel-background.c
@@ -1001,13 +1001,19 @@ void
eel_bg_load_from_gsettings (EelBackground *self,
GSettings *settings)
{
- char *keyfile = g_settings_get_string (settings, MATE_BG_KEY_PICTURE_FILENAME);
+ char *picture_filename;
- if (!g_file_test (keyfile, G_FILE_TEST_EXISTS) && (*keyfile != '\0'))
+ picture_filename = g_settings_get_string (settings,
+ MATE_BG_KEY_PICTURE_FILENAME);
+ if ((*picture_filename != '\0') &&
+ !g_file_test (picture_filename, G_FILE_TEST_EXISTS))
{
- *keyfile = '\0';
- g_settings_set_string (settings, MATE_BG_KEY_PICTURE_FILENAME, keyfile);
+ *picture_filename = '\0';
+ g_settings_set_string (settings,
+ MATE_BG_KEY_PICTURE_FILENAME,
+ picture_filename);
}
+ g_free (picture_filename);
if (self->details->bg)
mate_bg_load_from_gsettings (self->details->bg,