diff options
author | Simo Sorce <ssorce@redhat.com> | 2009-07-31 09:52:14 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2009-08-10 09:42:18 -0400 |
commit | 2b0f40eaba44742fa38bb5b67ada510e7b2b6324 (patch) | |
tree | 10317ab1e5428020e0363c45a3e943141a14e519 /server/providers/data_provider.c | |
parent | 508b5b2a360c9530c6ea67a7b7ed6d61559846e4 (diff) | |
download | sssd-2b0f40eaba44742fa38bb5b67ada510e7b2b6324.tar.gz sssd-2b0f40eaba44742fa38bb5b67ada510e7b2b6324.tar.xz sssd-2b0f40eaba44742fa38bb5b67ada510e7b2b6324.zip |
Remove redundant memory contexts
Simplify code by removing stuff that is never used or redundant.
Diffstat (limited to 'server/providers/data_provider.c')
-rw-r--r-- | server/providers/data_provider.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/server/providers/data_provider.c b/server/providers/data_provider.c index 4dc9dfaa8..6a19247fd 100644 --- a/server/providers/data_provider.c +++ b/server/providers/data_provider.c @@ -55,7 +55,6 @@ struct dp_frontend; struct dp_ctx { struct tevent_context *ev; struct confdb_ctx *cdb; - struct service_sbus_ctx *ss_ctx; struct sbus_srv_ctx *sbus_srv; struct dp_backend *be_list; struct dp_frontend *fe_list; @@ -195,10 +194,10 @@ static int service_res_init(DBusMessage *message, struct sbus_conn_ctx *sconn) static int dp_monitor_init(struct dp_ctx *dpctx) { - int ret; - char *sbus_address; - struct service_sbus_ctx *ss_ctx; + struct sbus_conn_ctx *conn_ctx; struct sbus_method_ctx *sm_ctx; + char *sbus_address; + int ret; /* Set up SBUS connection to the monitor */ ret = monitor_get_sbus_address(dpctx, dpctx->cdb, &sbus_address); @@ -213,11 +212,15 @@ static int dp_monitor_init(struct dp_ctx *dpctx) return ret; } - ret = sbus_client_init(dpctx, dpctx->ev, - sbus_address, sm_ctx, - NULL /* Private Data */, - NULL /* Destructor */, - &ss_ctx); + /* FIXME: remove this */ + if (talloc_reference(dpctx, sm_ctx) == NULL) { + DEBUG(0, ("Failed to take memory reference\n")); + return ENOMEM; + } + + ret = sbus_client_init(dpctx, dpctx->ev, sm_ctx, + sbus_address, &conn_ctx, + NULL, NULL); if (ret != EOK) { DEBUG(0, ("Failed to connect to monitor services.\n")); return ret; @@ -226,8 +229,6 @@ static int dp_monitor_init(struct dp_ctx *dpctx) /* Set up DP-specific listeners */ /* None currently used */ - dpctx->ss_ctx = ss_ctx; - return EOK; } |