diff options
author | Stephen Gallagher <sgallagh@sgallagh.bos.redhat.com> | 2008-12-15 10:35:49 -0500 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2008-12-15 15:41:50 -0500 |
commit | 519a8e9cba9df29a396d6509fb71a10ef1aacec0 (patch) | |
tree | 0efea08883d6a3fff9cbdd1f1689140bd5e702e0 /server/sbus | |
parent | 124083f5801312aeef6f97402dba181d98eb708c (diff) | |
download | sssd-519a8e9cba9df29a396d6509fb71a10ef1aacec0.tar.gz sssd-519a8e9cba9df29a396d6509fb71a10ef1aacec0.tar.xz sssd-519a8e9cba9df29a396d6509fb71a10ef1aacec0.zip |
Adding a parameter to the sbus_service_sbus_init function to allow passing in an sbus_conn_destructor_fn to the sbus_new_connection() function. Fixing minor warning about the usage of talloc_reference.
Diffstat (limited to 'server/sbus')
-rw-r--r-- | server/sbus/sssd_dbus_connection.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/server/sbus/sssd_dbus_connection.c b/server/sbus/sssd_dbus_connection.c index e4e122648..79f138ab1 100644 --- a/server/sbus/sssd_dbus_connection.c +++ b/server/sbus/sssd_dbus_connection.c @@ -533,6 +533,7 @@ int sbus_conn_add_method_ctx(struct sbus_conn_ctx *dct_ctx, { DBusObjectPathVTable *connection_vtable; struct sbus_message_handler_ctx *msg_handler_ctx; + TALLOC_CTX *tmp_ctx; dbus_bool_t dbret; if (!dct_ctx||!method_ctx) { @@ -548,7 +549,10 @@ 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); + if((tmp_ctx = talloc_reference(dct_ctx, method_ctx))!=method_ctx) { + /* talloc_reference only fails on insufficient memory */ + return ENOMEM; + } /* Set up the vtable for the object path */ connection_vtable = talloc_zero(dct_ctx, DBusObjectPathVTable); |