Blob Blame History Raw
From fe3c1d8d269dae06cf0566e6a403e293ee24f282 Mon Sep 17 00:00:00 2001
From: Jeremy Bicha <jbicha@ubuntu.com>
Date: Wed, 8 Aug 2018 04:40:17 -0400
Subject: [PATCH] housekeeping: fix improper notify_notification_close() usage
 (#234)

notify_notification_close() expects that a parameter will be available for
the error location, which could be a dangling pointer in a register or
on the stack in the case of some architectures.

This was caught by GNOME/glib#1425 which allows us to check proper type
parameters.

Cherry-picked to cinnamon-settings-daemon from
https://gitlab.gnome.org/GNOME/gnome-settings-daemon/commit/3110457f
---
 plugins/housekeeping/csd-disk-space.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/plugins/housekeeping/csd-disk-space.c b/plugins/housekeeping/csd-disk-space.c
index 83471e9..f603727 100644
--- a/plugins/housekeeping/csd-disk-space.c
+++ b/plugins/housekeeping/csd-disk-space.c
@@ -796,7 +796,8 @@ csd_ldsm_clean (void)
         g_clear_object (&ldsm_monitor);
         g_clear_object (&settings);
         g_clear_object (&dialog);
-        g_clear_pointer (&notification, notify_notification_close);
+        if (notification != NULL)
+                notify_notification_close (notification, NULL);
         g_slist_free_full (ignore_paths, g_free);
         ignore_paths = NULL;
 }