summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Hergert <chergert@redhat.com>2018-07-18 19:31:17 -0700
committerChristian Hergert <chergert@redhat.com>2018-07-18 19:31:17 -0700
commit3110457f72f70b2d283c1ad2f27b91b95d75d92f (patch)
tree17c415727e8af25a728c7fa63f7a95a81a2cbbd6
parent6417d8185dc825f837173a5c751f715b16483c5a (diff)
downloadgnome-settings-daemon-wip/chergert/g_clear_pointer.tar.gz
housekeeping: fix improper notify_notification_close() usagewip/chergert/g_clear_pointer
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.
-rw-r--r--plugins/housekeeping/gsd-disk-space.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/housekeeping/gsd-disk-space.c b/plugins/housekeeping/gsd-disk-space.c
index 0ae40193..0eee94ea 100644
--- a/plugins/housekeeping/gsd-disk-space.c
+++ b/plugins/housekeeping/gsd-disk-space.c
@@ -1017,7 +1017,9 @@ gsd_ldsm_clean (void)
g_clear_object (&ldsm_monitor);
g_clear_object (&settings);
g_clear_object (&privacy_settings);
- g_clear_pointer (&notification, notify_notification_close);
+ /* NotifyNotification::closed callback will drop reference */
+ if (notification != NULL)
+ notify_notification_close (notification, NULL);
g_slist_free_full (ignore_paths, g_free);
ignore_paths = NULL;
}