[UDFS] Avoid freeing Vcb when it couldn't have been allocated in UDFPnpSurpriseRemove()

CORE-11203
This commit is contained in:
Victor Martinez 2019-08-17 16:44:57 +03:00 committed by Victor Perevertkin
parent e5e4362b6d
commit d60acd88cb

View file

@ -588,7 +588,12 @@ Return Value:
// Knock as many files down for this volume as we can.
Vcb->Vpb->RealDevice->Flags |= DO_VERIFY_VOLUME;
Buf = (PPREVENT_MEDIA_REMOVAL_USER_IN)MyAllocatePool__(NonPagedPool, sizeof(PREVENT_MEDIA_REMOVAL_USER_IN));
if(!Buf) try_return(RC = STATUS_INSUFFICIENT_RESOURCES);
if(!Buf) {
VcbAcquired = FALSE;
VcbDeleted = FALSE;
try_return(RC = STATUS_INSUFFICIENT_RESOURCES);
}
UDFDoDismountSequence(Vcb, Buf, FALSE);
Vcb->VCBFlags &= ~UDF_VCB_FLAGS_VOLUME_MOUNTED;
Vcb->WriteSecurity = FALSE;