[FFS] Don't leak on failure

CID 1363596
This commit is contained in:
Pierre Schweitzer 2017-10-23 10:30:27 +02:00
parent 34d74fbd17
commit 361664d57f

View file

@ -255,6 +255,10 @@ FFSReadWriteBlocks(
(CCHAR)(Vcb->TargetDeviceObject->StackSize + 1)); (CCHAR)(Vcb->TargetDeviceObject->StackSize + 1));
if (!Irp) if (!Irp)
{ {
#ifdef __REACTOS__
ExFreePoolWithTag(pContext, FFS_POOL_TAG);
pContext = NULL;
#endif
Status = STATUS_INSUFFICIENT_RESOURCES; Status = STATUS_INSUFFICIENT_RESOURCES;
_SEH2_LEAVE; _SEH2_LEAVE;
} }
@ -268,6 +272,10 @@ FFSReadWriteBlocks(
if (!Mdl) if (!Mdl)
{ {
#ifdef __REACTOS__
ExFreePoolWithTag(pContext, FFS_POOL_TAG);
pContext = NULL;
#endif
Status = STATUS_INSUFFICIENT_RESOURCES; Status = STATUS_INSUFFICIENT_RESOURCES;
_SEH2_LEAVE; _SEH2_LEAVE;
} }