diff options
author | Pavel Reichl <preichl@redhat.com> | 2014-04-04 14:09:24 +0200 |
---|---|---|
committer | Sumit Bose <sbose@redhat.com> | 2014-04-08 11:48:41 +0200 |
commit | 0253068ffa8a18f8479c22b85bc3f34ea842f9a5 (patch) | |
tree | cf51c775b2bc1c386cbcff3328bda04e6574d3df | |
parent | dd5204c83b2b9fb5391a25682d8d3bfe1a6ec7f8 (diff) | |
download | sssd-wip.tar.gz sssd-wip.tar.xz sssd-wip.zip |
PAC: check return value of hash_entrieswip
Warning reported by clang
-rw-r--r-- | src/responder/pac/pacsrv_cmd.c | 14 |
1 files 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) |