From 5f93f452e4a80d6b0243eaf3c583d0caf9981ca0 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Thu, 26 Apr 2012 13:06:26 +0200 Subject: AUTOFS: remove unused assignments Also changes setautomntent_send so that is only return NULL in case the tevent_req creation fails. --- src/responder/autofs/autofssrv_cmd.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/responder') diff --git a/src/responder/autofs/autofssrv_cmd.c b/src/responder/autofs/autofssrv_cmd.c index ebf68b84a..7064591ab 100644 --- a/src/responder/autofs/autofssrv_cmd.c +++ b/src/responder/autofs/autofssrv_cmd.c @@ -361,13 +361,14 @@ setautomntent_send(TALLOC_CTX *mem_ctx, if (!req) { DEBUG(SSSDBG_FATAL_FAILURE, ("Could not create tevent request for setautomntent\n")); - goto fail; + return NULL; } state->cmdctx = cmdctx; dctx = talloc_zero(state, struct autofs_dom_ctx); if (!dctx) { DEBUG(SSSDBG_FATAL_FAILURE, ("Out of memory\n")); + ret = ENOMEM; goto fail; } dctx->cmd_ctx = state->cmdctx; @@ -388,11 +389,13 @@ setautomntent_send(TALLOC_CTX *mem_ctx, if (domname) { dctx->domain = responder_get_domain(dctx, client->rctx, domname); if (!dctx->domain) { + ret = EINVAL; goto fail; } client->automntmap_name = talloc_strdup(client, rawname); if (!client->automntmap_name) { + ret = ENOMEM; goto fail; } } else { @@ -402,6 +405,7 @@ setautomntent_send(TALLOC_CTX *mem_ctx, client->automntmap_name = talloc_strdup(client, state->mapname); if (!client->automntmap_name) { + ret = ENOMEM; goto fail; } } @@ -504,6 +508,7 @@ setautomntent_send(TALLOC_CTX *mem_ctx, } else if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, ("Could not get data from cache\n")); talloc_free(state->map); + ret = ENOMEM; goto fail; } @@ -520,8 +525,9 @@ setautomntent_send(TALLOC_CTX *mem_ctx, return req; fail: - talloc_free(req); - return NULL; + tevent_req_error(req, ret); + tevent_req_post(req, actx->rctx->ev); + return req; } static errno_t @@ -585,7 +591,6 @@ lookup_automntmap_step(struct setautomntent_lookup_ctx *lookup_ctx) } else break; } - ret = EOK; } ret = get_autofs_map(lookup_ctx->actx, lookup_ctx->mapname, &map); -- cgit