diff --git a/src/afs/DARWIN/osi_machdep.h b/src/afs/DARWIN/osi_machdep.h index f513020860..175005291b 100644 --- a/src/afs/DARWIN/osi_machdep.h +++ b/src/afs/DARWIN/osi_machdep.h @@ -105,7 +105,7 @@ enum vcexcl { EXCL, NONEXCL }; #define crref kauth_cred_get_with_ref #define crhold kauth_cred_ref #ifdef AFS_DARWIN100_ENV -static inline void crfree(kauth_cred_t X) { kauth_cred_unref(&X); } +#define crfree(X) kauth_cred_unref(&X) #else #define crfree kauth_cred_rele #endif diff --git a/src/afs/VNOPS/afs_vnop_write.c b/src/afs/VNOPS/afs_vnop_write.c index 0f6007b593..5ef62aaead 100644 --- a/src/afs/VNOPS/afs_vnop_write.c +++ b/src/afs/VNOPS/afs_vnop_write.c @@ -47,6 +47,8 @@ afs_StoreOnLastReference(struct vcache *avc, * flag will already be clear, so we don't have to worry about * clearing it twice. */ if (avc->f.states & CCore) { + afs_ucred_t *cred; + avc->f.states &= ~CCore; #if defined(AFS_SGI_ENV) osi_Assert(avc->opens > 0 && avc->execsOrWriters > 0); @@ -58,7 +60,8 @@ afs_StoreOnLastReference(struct vcache *avc, avc->opens--; avc->execsOrWriters--; AFS_RELE(AFSTOV(avc)); /* VN_HOLD at set CCore(afs_FakeClose) */ - crfree((afs_ucred_t *)avc->linkData); /* "crheld" in afs_FakeClose */ + cred = (afs_ucred_t *)avc->linkData; /* "crheld" in afs_FakeClose */ + crfree(cred); avc->linkData = NULL; }