From: Simon McVittie Date: Tue, 21 Nov 2017 14:36:02 +0000 (+0000) Subject: _dbus_server_new_for_socket: Invalidate watches during error unwinding X-Git-Tag: dbus-1.12.4~24 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=58c9a56dbb2096a0a9ad6840353a9301aca5edb3;p=thirdparty%2Fdbus.git _dbus_server_new_for_socket: Invalidate watches during error unwinding We assert that every watch is invalidated before it is freed, but in some OOM code paths this didn't happen. Signed-off-by: Simon McVittie Reviewed-by: Philip Withnall Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89104 (cherry picked from commit 1ce34beef85a7a0b3c25890837e3a72f8bdac1f0) --- diff --git a/dbus/dbus-server-socket.c b/dbus/dbus-server-socket.c index d716f5002..61e143ba9 100644 --- a/dbus/dbus-server-socket.c +++ b/dbus/dbus-server-socket.c @@ -358,6 +358,7 @@ _dbus_server_new_for_socket (DBusSocket *fds, { if (socket_server->watch[i] != NULL) { + _dbus_watch_invalidate (socket_server->watch[i]); _dbus_watch_unref (socket_server->watch[i]); socket_server->watch[i] = NULL; }