From 039d997b19cffa2f5428bb3d85669ebc5888307a Mon Sep 17 00:00:00 2001 From: Jan Zeleny Date: Thu, 2 Sep 2010 13:27:25 +0200 Subject: Dead assignments cleanup in memberof module Some assignments deleted, two return value inspections were added. Ticket: #589 --- src/ldb_modules/memberof.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/ldb_modules') diff --git a/src/ldb_modules/memberof.c b/src/ldb_modules/memberof.c index c3f57630e..1e28593dd 100644 --- a/src/ldb_modules/memberof.c +++ b/src/ldb_modules/memberof.c @@ -1712,14 +1712,12 @@ static int mbof_del_execute_cont(struct mbof_del_operation *delop) struct mbof_del_operation *parent; struct mbof_del_ctx *del_ctx; struct mbof_ctx *ctx; - struct ldb_context *ldb; struct mbof_dn_array *new_list; int i; del_ctx = delop->del_ctx; parent = delop->parent; ctx = del_ctx->ctx; - ldb = ldb_module_get_ctx(ctx->module); anc_ctx = talloc_zero(delop, struct mbof_del_ancestors_ctx); if (!anc_ctx) { @@ -2194,11 +2192,9 @@ static int mbof_del_get_next(struct mbof_del_operation *delop, { struct mbof_del_operation *top, *cop; struct mbof_del_ctx *del_ctx; - struct mbof_ctx *ctx; struct mbof_dn *save, *tmp; del_ctx = delop->del_ctx; - ctx = del_ctx->ctx; /* first of all, save the current delop in the history */ save = talloc_zero(del_ctx, struct mbof_dn); @@ -2796,12 +2792,10 @@ static int mbof_mod_delete(struct mbof_mod_ctx *mod_ctx, { struct mbof_del_operation *first; struct mbof_del_ctx *del_ctx; - struct ldb_context *ldb; struct mbof_ctx *ctx; int i, ret; ctx = mod_ctx->ctx; - ldb = ldb_module_get_ctx(ctx->module); del_ctx = talloc_zero(mod_ctx, struct mbof_del_ctx); if (!del_ctx) { @@ -3603,7 +3597,10 @@ static int memberof_init(struct ldb_module *module) /* set syntaxes for member and memberof so that comparisons in filters and * such are done right */ ret = ldb_schema_attribute_add(ldb, DB_MEMBER, 0, LDB_SYNTAX_DN); + if (ret != 0) return LDB_ERR_OPERATIONS_ERROR; + ret = ldb_schema_attribute_add(ldb, DB_MEMBEROF, 0, LDB_SYNTAX_DN); + if (ret != 0) return LDB_ERR_OPERATIONS_ERROR; return ldb_next_init(module); } -- cgit