summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2009-08-10 18:39:15 -0400
committerStephen Gallagher <sgallagh@redhat.com>2009-08-11 12:29:35 -0400
commit38268cfc515e1f136cabfbcc9a620a2d9c929cda (patch)
tree31e6268faa3c807f348d606e4c87e9496fe495c1 /server
parent68f2b4f2a90cb6fef3a6ffd88a1aee34c0e91276 (diff)
downloadsssd-38268cfc515e1f136cabfbcc9a620a2d9c929cda.tar.gz
sssd-38268cfc515e1f136cabfbcc9a620a2d9c929cda.tar.bz2
sssd-38268cfc515e1f136cabfbcc9a620a2d9c929cda.zip
Minor fixes
Diffstat (limited to 'server')
-rw-r--r--server/sbus/sssd_dbus_common.c18
-rw-r--r--server/sbus/sssd_dbus_server.c2
2 files changed, 13 insertions, 7 deletions
diff --git a/server/sbus/sssd_dbus_common.c b/server/sbus/sssd_dbus_common.c
index 0c16f9f5..76cb3c20 100644
--- a/server/sbus/sssd_dbus_common.c
+++ b/server/sbus/sssd_dbus_common.c
@@ -18,12 +18,18 @@ static void sbus_watch_handler(struct tevent_context *ev,
{
struct sbus_watch_ctx *watch = talloc_get_type(data,
struct sbus_watch_ctx);
+ enum dbus_conn_type type;
+ union dbus_conn_pointer dbus_p;
+
+ /* conn may get freed inside a handle, save the data we need for later */
+ type = watch->conn->type;
+ dbus_p = watch->conn->dbus;
/* Take a reference while handling watch */
- if (watch->conn->type == SBUS_SERVER) {
- dbus_server_ref(watch->conn->dbus.server);
+ if (type == SBUS_SERVER) {
+ dbus_server_ref(dbus_p.server);
} else {
- dbus_connection_ref(watch->conn->dbus.conn);
+ dbus_connection_ref(dbus_p.conn);
}
/* Fire if readable */
@@ -37,10 +43,10 @@ static void sbus_watch_handler(struct tevent_context *ev,
}
/* Release reference once done */
- if (watch->conn->type == SBUS_SERVER) {
- dbus_server_unref(watch->conn->dbus.server);
+ if (type == SBUS_SERVER) {
+ dbus_server_unref(dbus_p.server);
} else {
- dbus_connection_unref(watch->conn->dbus.conn);
+ dbus_connection_unref(dbus_p.conn);
}
}
diff --git a/server/sbus/sssd_dbus_server.c b/server/sbus/sssd_dbus_server.c
index ef2de106..a859cbab 100644
--- a/server/sbus/sssd_dbus_server.c
+++ b/server/sbus/sssd_dbus_server.c
@@ -48,7 +48,7 @@ static void sbus_server_init_new_connection(DBusServer *dbus_server,
return;
}
- DEBUG(5,("Adding connection %lX.\n", conn));
+ DEBUG(5,("Adding connection %p.\n", dbus_conn));
ret = sbus_init_connection(server, server->ev,
dbus_conn, server->server_intf,
SBUS_CONN_TYPE_PRIVATE, &conn);