_dbus_server_new_for_socket: Properly disconnect during error unwinding
authorSimon McVittie <smcv@collabora.com>
Tue, 21 Nov 2017 14:38:13 +0000 (14:38 +0000)
committerSimon McVittie <smcv@collabora.com>
Fri, 24 Nov 2017 13:16:30 +0000 (13:16 +0000)
commitd166252a8d6769a8ac3480b8fcce611b3783e4cc
treeaf56af206d35e387b40312569a9fe95ccb731949
parent58c9a56dbb2096a0a9ad6840353a9301aca5edb3
_dbus_server_new_for_socket: Properly disconnect during error unwinding

_dbus_server_finalize_base() asserts that the socket has been
disconnected, but in some OOM code paths we would call it without
officially disconnecting. Do so.

This means we need to be a bit more careful about what is
socket_disconnect()'s responsibility to clean up, what is
_dbus_server_new_for_socket()'s responsibility, and what is the caller's
responsibility.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89104
(cherry picked from commit 0c03b505a9718c6d497caffb7d6083371679a852)
dbus/dbus-server-protected.h
dbus/dbus-server-socket.c
dbus/dbus-server.c