From b9a25a4f24ffb23874e0923f63c75149f13b071c Mon Sep 17 00:00:00 2001 From: rbuj Date: Mon, 8 Nov 2021 12:44:21 +0100 Subject: mate-bg: fix memory leak --- libmate-desktop/mate-bg.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libmate-desktop/mate-bg.c b/libmate-desktop/mate-bg.c index 5d32425..e60f013 100644 --- a/libmate-desktop/mate-bg.c +++ b/libmate-desktop/mate-bg.c @@ -3186,9 +3186,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; } -- cgit v1.2.1