From 8cae6755d2d2f50765d43a68de0be09ee98659ed Mon Sep 17 00:00:00 2001 From: Sumit Bose Date: Fri, 23 Aug 2013 10:13:02 +0200 Subject: 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. --- src/providers/krb5/krb5_utils.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src') 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 ========*/ -- cgit