[gnome-settings-daemon] updates: Prevent crashes due to use after free



commit d3e199fca4155bfbdabcacd4b720a8f7b0cc414d
Author: Rui Matos <tiagomatos gmail com>
Date:   Wed Sep 4 16:59:55 2013 +0200

    updates: Prevent crashes due to use after free
    
    Should fix both of these issues:
    https://retrace.fedoraproject.org/faf/problems/206547/
    https://retrace.fedoraproject.org/faf/problems/242602/
    
    https://bugzilla.gnome.org/show_bug.cgi?id=707480

 plugins/updates/gsd-updates-manager.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/plugins/updates/gsd-updates-manager.c b/plugins/updates/gsd-updates-manager.c
index 465e55a..0706bf1 100644
--- a/plugins/updates/gsd-updates-manager.c
+++ b/plugins/updates/gsd-updates-manager.c
@@ -494,6 +494,8 @@ notify_critical_updates (GsdUpdatesManager *manager, GPtrArray *array)
         }
         /* track so we can prevent doubled notifications */
         manager->priv->notification_updates = notification;
+        g_object_add_weak_pointer (G_OBJECT (manager->priv->notification_updates),
+                                   (void **) &manager->priv->notification_updates);
 }
 
 static void
@@ -562,6 +564,8 @@ notify_normal_updates_maybe (GsdUpdatesManager *manager, GPtrArray *array)
 
         /* track so we can prevent doubled notifications */
         manager->priv->notification_updates = notification;
+        g_object_add_weak_pointer (G_OBJECT (manager->priv->notification_updates),
+                                   (void **) &manager->priv->notification_updates);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]