Windows: Protect against null volp dereference

In cm_RecycleSCache cm_GetVolumeByFID can fail leaving 'volp'
a NULL pointer.  Do not call cm_PutVolume() if cm_GetVolumeByFID
fails.

Change-Id: I57eaf5d40130ecad75a312ef5487cdfa6e7367e3
Reviewed-on: http://gerrit.openafs.org/7506
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
This commit is contained in:
Jeffrey Altman 2012-05-27 11:20:11 -04:00 committed by Jeffrey Altman
parent ce8d0aefd1
commit e94b233869

View File

@ -173,9 +173,12 @@ long cm_RecycleSCache(cm_scache_t *scp, afs_int32 flags)
!cm_accessPerFileCheck) {
cm_volume_t *volp = cm_GetVolumeByFID(&scp->fid);
if (!(volp && (volp->flags & CM_VOLUMEFLAG_DFS_VOLUME)))
cm_EAccesClearParentEntries(&fid);
cm_PutVolume(volp);
if (volp) {
if (!(volp->flags & CM_VOLUMEFLAG_DFS_VOLUME))
cm_EAccesClearParentEntries(&fid);
cm_PutVolume(volp);
}
}
/* invalidate so next merge works fine;