diff options
author | rbuj <[email protected]> | 2021-10-23 13:18:49 +0200 |
---|---|---|
committer | rbuj <[email protected]> | 2021-12-31 13:13:47 +0100 |
commit | 5ce0d61fbea4a72993847c308c4098048974156d (patch) | |
tree | f1462c79200e9636ed4933d52fdb49c137d3eda7 | |
parent | e99902aa79f15687b746d237ae0790795c8bb094 (diff) | |
download | caja-5ce0d61fbea4a72993847c308c4098048974156d.tar.bz2 caja-5ce0d61fbea4a72993847c308c4098048974156d.tar.xz |
eel-background: fix memory leak
-rw-r--r-- | eel/eel-background.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/eel/eel-background.c b/eel/eel-background.c index adeed503..c8bbc68a 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, |