summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-10-23 13:18:49 +0200
committerRobert Antoni Buj Gelonch <[email protected]>2021-12-31 12:50:02 +0100
commitd13f977a8c9b8701579199e888c2436bc00959a2 (patch)
tree3e2276285822df5e7b533d6287a70c34e3b4d94f
parent1153ce676a25d21dc3dd3e67dc21e343b28b55bf (diff)
downloadcaja-d13f977a8c9b8701579199e888c2436bc00959a2.tar.bz2
caja-d13f977a8c9b8701579199e888c2436bc00959a2.tar.xz
eel-background: fix memory leak
-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,