summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-10-23 13:18:49 +0200
committerraveit65 <[email protected]>2022-07-21 19:33:52 +0200
commita3636b6e6e9123ffb6d466be4f003f83fa8a5299 (patch)
treebdf8375d1d0550ee11c8bdc9097fba28b5d36d87
parent085d20cd65574ba322b2c3a6b2e1d53b9da6c3f2 (diff)
downloadcaja-a3636b6e6e9123ffb6d466be4f003f83fa8a5299.tar.bz2
caja-a3636b6e6e9123ffb6d466be4f003f83fa8a5299.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 5fc95215..b0fc1a15 100644
--- a/eel/eel-background.c
+++ b/eel/eel-background.c
@@ -1003,13 +1003,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,