From 6268d3668a939f32919f1b0d37c94b308af66536 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Thu, 6 Sep 2007 22:20:24 +0200 Subject: [PATCH] config/dbus: don't call RemoveGeneralSocket if bus_info.fd == -1 Fixes a crash reported at: http://bugs.freedesktop.org/show_bug.cgi?id=12291 --- config/dbus-core.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config/dbus-core.c b/config/dbus-core.c index 2888159..d220cea 100644 --- a/config/dbus-core.c +++ b/config/dbus-core.c @@ -87,8 +87,10 @@ teardown(void) dbus_connection_unref(bus_info.connection); RemoveBlockAndWakeupHandlers(block_handler, wakeup_handler, &bus_info); - RemoveGeneralSocket(bus_info.fd); - bus_info.fd = -1; + if (bus_info.fd != -1) { + RemoveGeneralSocket(bus_info.fd); + bus_info.fd = -1; + } bus_info.connection = NULL; for (hook = bus_info.hooks; hook; hook = hook->next) { -- 1.5.3.1