summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeepika Aggarwal <deepika.a@samsung.com>2015-12-07 16:56:06 +0530
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2016-07-01 16:42:18 +0100
commit187ae737ec3319383cfe5e6282d1c7e0b9550dcc (patch)
treef1cbc378da3a6a4318f1d48b46a422dc0da58c1b
parent42a514d9178ef16eb9a860a2ca2d813811457d38 (diff)
bus: reassure static analysis tool that server slot allocation can't fail
The NULL-dereference is not actually possible in this case, because we know that the allocation and setup were done previously. Signed-off-by: Deepika Aggarwal <deepika.a@samsung.com> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93210
-rw-r--r--bus/bus.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/bus/bus.c b/bus/bus.c
index fd4ab9e4..9f1daa2e 100644
--- a/bus/bus.c
+++ b/bus/bus.c
@@ -90,19 +90,15 @@ server_get_context (DBusServer *server)
BusContext *context;
BusServerData *bd;
- if (!dbus_server_allocate_data_slot (&server_data_slot))
- return NULL;
+ /* this data slot was allocated by the BusContext */
+ _dbus_assert (server_data_slot >= 0);
bd = BUS_SERVER_DATA (server);
- if (bd == NULL)
- {
- dbus_server_free_data_slot (&server_data_slot);
- return NULL;
- }
- context = bd->context;
+ /* every DBusServer in the dbus-daemon has gone through setup_server() */
+ _dbus_assert (bd != NULL);
- dbus_server_free_data_slot (&server_data_slot);
+ context = bd->context;
return context;
}