From f3b810a815b5e9c392660436bf2b5d846111ec6b Mon Sep 17 00:00:00 2001 From: Deepika Aggarwal Date: Fri, 4 Dec 2015 14:59:58 +0530 Subject: [PATCH] Null derefrence fixed using dbus_assert Description: dbus_assert added for better error handling and prevent null return dereference Signed-off-by: Deepika Aggarwal --- bus/bus.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/bus/bus.c b/bus/bus.c index fd4ab9e..6ca514a 100644 --- a/bus/bus.c +++ b/bus/bus.c @@ -90,15 +90,11 @@ server_get_context (DBusServer *server) BusContext *context; BusServerData *bd; - if (!dbus_server_allocate_data_slot (&server_data_slot)) - return NULL; + dbus_server_allocate_data_slot (&server_data_slot); + _dbus_assert (server_data_slot >= 0); bd = BUS_SERVER_DATA (server); - if (bd == NULL) - { - dbus_server_free_data_slot (&server_data_slot); - return NULL; - } + _dbus_assert (bd != NULL); context = bd->context; -- 1.7.9.5