summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-11-08 12:44:21 +0100
committerraveit65 <[email protected]>2023-03-15 18:55:42 +0100
commit2fbe25e7ad9c7678db2f3e34f76c9ee4e37d80d9 (patch)
tree5992018877445cfe8303bb22aa8024e15c12844e
parentecf9baac8832edde5e950a70621d2b6c694f9536 (diff)
downloadmate-desktop-2fbe25e7ad9c7678db2f3e34f76c9ee4e37d80d9.tar.bz2
mate-desktop-2fbe25e7ad9c7678db2f3e34f76c9ee4e37d80d9.tar.xz
mate-bg: fix memory leak
-rw-r--r--libmate-desktop/mate-bg.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libmate-desktop/mate-bg.c b/libmate-desktop/mate-bg.c
index e511975..62cc5e5 100644
--- a/libmate-desktop/mate-bg.c
+++ b/libmate-desktop/mate-bg.c
@@ -3197,9 +3197,13 @@ mate_bg_changes_with_time (MateBG *bg)
if (!bg->filename)
return FALSE;
- show = get_as_slideshow (bg, bg->filename);
- if (show)
- return g_queue_get_length (show->slides) > 1;
+ if ((show = get_as_slideshow (bg, bg->filename)) != NULL) {
+ gboolean result;
+
+ result = (g_queue_get_length (show->slides) > 1) ? TRUE : FALSE;
+ slideshow_unref (show);
+ return result;
+ }
return FALSE;
}