diff options
author | Stephen Gallagher <sgallagh@sgallagh.bos.redhat.com> | 2008-12-15 10:12:43 -0500 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2008-12-15 15:40:25 -0500 |
commit | 124083f5801312aeef6f97402dba181d98eb708c (patch) | |
tree | 8158ed73911b2e9d4c047cffa2a0ea4205c38709 /server/sbus/sssd_dbus_connection.c | |
parent | a5442a122917088afff240846700e858f45fe1de (diff) | |
download | sssd-124083f5801312aeef6f97402dba181d98eb708c.tar.gz sssd-124083f5801312aeef6f97402dba181d98eb708c.tar.xz sssd-124083f5801312aeef6f97402dba181d98eb708c.zip |
Disconnected client SBUS connections would delete the master set of sbus_method_ctx entries, meaning that the next connection to attempt to disconnect would receive a segmentation fault also trying to delete them. They are now talloc_reference()-ed to their connection context and talloc_unlink()-ed upon deletion.
I have also modified the sbus_new_server() call to take a reference
to an sbus_srv_ctx object as a return argument, so that the calling
function can keep track of the SBUS server context if it so chooses.
Diffstat (limited to 'server/sbus/sssd_dbus_connection.c')
-rw-r--r-- | server/sbus/sssd_dbus_connection.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/server/sbus/sssd_dbus_connection.c b/server/sbus/sssd_dbus_connection.c index b1c765562..e4e122648 100644 --- a/server/sbus/sssd_dbus_connection.c +++ b/server/sbus/sssd_dbus_connection.c @@ -548,6 +548,7 @@ int sbus_conn_add_method_ctx(struct sbus_conn_ctx *dct_ctx, } DLIST_ADD(dct_ctx->method_ctx_list, method_ctx); + talloc_reference(dct_ctx, method_ctx); /* Set up the vtable for the object path */ connection_vtable = talloc_zero(dct_ctx, DBusObjectPathVTable); @@ -603,7 +604,7 @@ static void sbus_unreg_object_paths(struct sbus_conn_ctx *dct_ctx) DLIST_REMOVE(dct_ctx->method_ctx_list, iter); purge = iter; iter = iter->next; - talloc_free(purge); + talloc_unlink(dct_ctx, purge); } } |