]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Properly size #ifdef in k5_cccol_lock() 895/head
authorRobbie Harwood <rharwood@redhat.com>
Thu, 14 Feb 2019 16:50:35 +0000 (11:50 -0500)
committerGreg Hudson <ghudson@mit.edu>
Sat, 16 Feb 2019 01:01:18 +0000 (20:01 -0500)
The cleanup code only could get executed in the USE_CCAPI_V3 case, so
move it inside that block.  Reported by Coverity.

src/lib/krb5/ccache/ccbase.c

index 6715ac9f069a51d29c9ee66a427ec008650e58d9..f53ba5042b8e99e5aa85c10786d2b76cfd8895d2 100644 (file)
@@ -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;
 }