check failed allocation (FDO Bug #12920)
authorJohn (J5) Palmieri <johnp@redhat.com>
Tue, 15 Jan 2008 20:49:35 +0000 (15:49 -0500)
committerJohn (J5) Palmieri <johnp@redhat.com>
Tue, 15 Jan 2008 20:49:35 +0000 (15:49 -0500)
2008-01-15  John (J5) Palmieri  <johnp@redhat.com>

* patch by Kimmo Hämäläinen <kimmo dot hamalainen at nokia dot com>

* bus/bus.c (setup_server): check failed allocation (FDO Bug #12920)

ChangeLog
bus/bus.c

index dfa00b1..4547176 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,12 @@
        
        * patch by Kimmo Hämäläinen <kimmo dot hamalainen at nokia dot com>
 
+       * bus/bus.c (setup_server): check failed allocation (FDO Bug #12920)
+       
+2008-01-15  John (J5) Palmieri  <johnp@redhat.com>
+       
+       * patch by Kimmo Hämäläinen <kimmo dot hamalainen at nokia dot com>
+
        * dbus/dbus-spawn.c (_dbus_spawn_async_with_babysitter): the API 
        contract says sitter_p can be NULL, so let's check it (FDO Bug #12919)
 
index 864e48b..a28a267 100644 (file)
--- a/bus/bus.c
+++ b/bus/bus.c
@@ -208,9 +208,9 @@ setup_server (BusContext *context,
   BusServerData *bd;
 
   bd = dbus_new0 (BusServerData, 1);
-  if (!dbus_server_set_data (server,
-                             server_data_slot,
-                             bd, free_server_data))
+  if (bd == NULL || !dbus_server_set_data (server,
+                                           server_data_slot,
+                                           bd, free_server_data))
     {
       dbus_free (bd);
       BUS_SET_OOM (error);