diff options
author | Pavel Reichl <preichl@redhat.com> | 2015-03-09 05:45:20 -0400 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2015-03-11 10:11:17 +0100 |
commit | 6ccda8691123bb27f5f2a88a0c80174af3e0fd0a (patch) | |
tree | 29bf072d8c7ac64eb919044441f8e5eee1d0b034 /src | |
parent | 04d138472cc086fb7961f0d378852b09961b1a33 (diff) | |
download | sssd-6ccda8691123bb27f5f2a88a0c80174af3e0fd0a.tar.gz sssd-6ccda8691123bb27f5f2a88a0c80174af3e0fd0a.tar.xz sssd-6ccda8691123bb27f5f2a88a0c80174af3e0fd0a.zip |
ldap_child: fix coverity warning
In ldap_child_get_tgt_sync() variable 'ret' got overriden in done
section without ever before being read.
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/providers/ldap/ldap_child.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/providers/ldap/ldap_child.c b/src/providers/ldap/ldap_child.c index 8f034affa..82481d6e7 100644 --- a/src/providers/ldap/ldap_child.c +++ b/src/providers/ldap/ldap_child.c @@ -391,14 +391,20 @@ static krb5_error_code ldap_child_get_tgt_sync(TALLOC_CTX *memctx, ccname_file = talloc_asprintf(tmp_ctx, "%s/ccache_%s", DB_PATH, realm_name); if (ccname_file == NULL) { - ret = ENOMEM; + krberr = ENOMEM; + DEBUG(SSSDBG_CRIT_FAILURE, + "talloc_asprintf failed: %s:[%d].\n", + strerror(krberr), krberr); goto done; } ccname_file_dummy = talloc_asprintf(tmp_ctx, "%s/ccache_%s_XXXXXX", DB_PATH, realm_name); if (ccname_file_dummy == NULL) { - ret = ENOMEM; + krberr = ENOMEM; + DEBUG(SSSDBG_CRIT_FAILURE, + "talloc_asprintf failed: %s:[%d].\n", + strerror(krberr), krberr); goto done; } @@ -407,6 +413,10 @@ static krb5_error_code ldap_child_get_tgt_sync(TALLOC_CTX *memctx, umask(old_umask); if (fd == -1) { ret = errno; + DEBUG(SSSDBG_CRIT_FAILURE, + "mkstemp failed: %s:[%d].\n", + strerror(ret), ret); + krberr = KRB5KRB_ERR_GENERIC; goto done; } /* We only care about creating a unique file name here, we don't |