diff options
author | Sumit Bose <sbose@redhat.com> | 2013-08-23 10:13:02 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-08-24 18:04:48 +0200 |
commit | 8cae6755d2d2f50765d43a68de0be09ee98659ed (patch) | |
tree | 57d466d4fa4aae2402ea6af5eb860bda887779f3 /src | |
parent | 8f1ba6b89634aebdb7fa2dff72aeed9b3058c765 (diff) | |
download | sssd-8cae6755d2d2f50765d43a68de0be09ee98659ed.tar.gz sssd-8cae6755d2d2f50765d43a68de0be09ee98659ed.tar.bz2 sssd-8cae6755d2d2f50765d43a68de0be09ee98659ed.zip |
check_cc_validity: make sure _valid is always set
In the KRB5_FCC_NOFILE code path _valid is not set leading to 'may be
used uninitialized' compiler warnings.
Diffstat (limited to 'src')
-rw-r--r-- | src/providers/krb5/krb5_utils.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/providers/krb5/krb5_utils.c b/src/providers/krb5/krb5_utils.c index 13ba9b5f..7a4d287a 100644 --- a/src/providers/krb5/krb5_utils.c +++ b/src/providers/krb5/krb5_utils.c @@ -750,12 +750,14 @@ check_cc_validity(const char *location, } ret = EOK; - *_valid = valid; - done: - if (ccache) krb5_cc_close(context, ccache); - krb5_free_context(context); - return ret; +done: + if (ret == EOK) { + *_valid = valid; + } + if (ccache) krb5_cc_close(context, ccache); + krb5_free_context(context); + return ret; } /*======== ccache back end utilities ========*/ |