[gnome-settings-daemon] power: NULL-guard return value of up_client_get_devices



commit 38dd64176410b5ded6ff132961ca2c7c13711071
Author: Michael Terry <michael terry canonical com>
Date:   Wed Apr 25 16:20:58 2012 -0400

    power: NULL-guard return value of up_client_get_devices
    
    https://bugzilla.gnome.org/show_bug.cgi?id=674827

 plugins/power/gsd-power-manager.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index 624a13d..c520a9e 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -1149,6 +1149,9 @@ engine_coldplug (GsdPowerManager *manager)
 
         /* add to database */
         array = up_client_get_devices (manager->priv->up_client);
+        if (array == NULL)
+                goto out;
+
         for (i=0;i<array->len;i++) {
                 device = g_ptr_array_index (array, i);
                 engine_device_add (manager, device);



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