summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2013-08-23 10:13:02 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-08-24 18:04:48 +0200
commit8cae6755d2d2f50765d43a68de0be09ee98659ed (patch)
tree57d466d4fa4aae2402ea6af5eb860bda887779f3 /src
parent8f1ba6b89634aebdb7fa2dff72aeed9b3058c765 (diff)
downloadsssd-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.c12
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 ========*/