From: Robbie Harwood Date: Thu, 14 Feb 2019 16:50:35 +0000 (-0500) Subject: Properly size #ifdef in k5_cccol_lock() X-Git-Tag: krb5-1.18-beta1~188 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=444a15f9cf82b9a6c1bca3f20307f82fee91c228;p=thirdparty%2Fkrb5.git Properly size #ifdef in k5_cccol_lock() The cleanup code only could get executed in the USE_CCAPI_V3 case, so move it inside that block. Reported by Coverity. --- diff --git a/src/lib/krb5/ccache/ccbase.c b/src/lib/krb5/ccache/ccbase.c index 6715ac9f06..f53ba5042b 100644 --- a/src/lib/krb5/ccache/ccbase.c +++ b/src/lib/krb5/ccache/ccbase.c @@ -511,7 +511,6 @@ k5_cccol_lock(krb5_context context) #endif #ifdef USE_CCAPI_V3 ret = krb5_stdccv3_context_lock(context); -#endif if (ret) { k5_cc_mutex_unlock(context, &krb5int_mcc_mutex); k5_cc_mutex_unlock(context, &krb5int_cc_file_mutex); @@ -519,6 +518,7 @@ k5_cccol_lock(krb5_context context) k5_cc_mutex_unlock(context, &cccol_lock); return ret; } +#endif k5_mutex_unlock(&cc_typelist_lock); return ret; }