summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2012-07-09 11:39:47 -0400
committerStephen Gallagher <sgallagh@redhat.com>2012-07-09 13:49:21 -0400
commit29bf02dbdd8168d7be04f4f15cff4321833a71c4 (patch)
treee3a96a9016e66892cf78b6b7a87c8c51e1f562be /src
parentbda8094867476bf5adcfe3409e34b09add50c9b4 (diff)
downloadsssd-29bf02dbdd8168d7be04f4f15cff4321833a71c4.tar.gz
sssd-29bf02dbdd8168d7be04f4f15cff4321833a71c4.tar.bz2
sssd-29bf02dbdd8168d7be04f4f15cff4321833a71c4.zip
Fix potential NULL-dereference
Coverity #12801
Diffstat (limited to 'src')
-rw-r--r--src/responder/sudo/sudosrv_get_sudorules.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/responder/sudo/sudosrv_get_sudorules.c b/src/responder/sudo/sudosrv_get_sudorules.c
index 65e475fb..13e1224b 100644
--- a/src/responder/sudo/sudosrv_get_sudorules.c
+++ b/src/responder/sudo/sudosrv_get_sudorules.c
@@ -325,7 +325,7 @@ errno_t sudosrv_get_rules(struct sudo_cmd_ctx *cmd_ctx)
TALLOC_CTX *tmp_ctx = NULL;
struct tevent_req *dpreq = NULL;
struct dp_callback_ctx *cb_ctx = NULL;
- struct sysdb_ctx *sysdb = cmd_ctx->domain->sysdb;
+ struct sysdb_ctx *sysdb;
char **groupnames = NULL;
size_t expired_rules_num = 0;
struct sysdb_attrs **expired_rules = NULL;
@@ -339,6 +339,8 @@ errno_t sudosrv_get_rules(struct sudo_cmd_ctx *cmd_ctx)
return EFAULT;
}
+ sysdb = cmd_ctx->domain->sysdb;
+
tmp_ctx = talloc_new(NULL);
if (tmp_ctx == NULL) {
DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new() failed\n"));