From 0253068ffa8a18f8479c22b85bc3f34ea842f9a5 Mon Sep 17 00:00:00 2001 From: Pavel Reichl Date: Fri, 4 Apr 2014 14:09:24 +0200 Subject: PAC: check return value of hash_entries Warning reported by clang --- src/responder/pac/pacsrv_cmd.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/responder/pac/pacsrv_cmd.c b/src/responder/pac/pacsrv_cmd.c index 229c30783..2fe76d1cf 100644 --- a/src/responder/pac/pacsrv_cmd.c +++ b/src/responder/pac/pacsrv_cmd.c @@ -267,15 +267,18 @@ static void pac_lookup_sids_done(struct tevent_req *req) talloc_zfree(req); if (ret != EOK) { - talloc_free(pr_ctx); - pac_cmd_done(cctx, ret); - return; + goto error; } key.type = HASH_KEY_STRING; value.type = HASH_VALUE_ULONG; ret = hash_entries(pr_ctx->sid_table, &count, &entries); + if (ret != HASH_SUCCESS) { + DEBUG(SSSDBG_CRIT_FAILURE, "hash_entries failed.\n"); + goto error; + } + for (c = 0; c < count; c++) { if (entries[c].value.ul == 0) { ret =responder_get_domain_by_id(cctx->rctx, @@ -335,6 +338,11 @@ static void pac_lookup_sids_done(struct tevent_req *req) } pac_add_user_next(pr_ctx); + return; + +error: + talloc_free(pr_ctx); + pac_cmd_done(cctx, ret); } static void pac_add_user_next(struct pac_req_ctx *pr_ctx) -- cgit