https://git.reactos.org/?p=reactos.git;a=commitdiff;h=361664d57fca98f01ec5c…
commit 361664d57fca98f01ec5c6d430d8901873d1ea7a
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Mon Oct 23 10:30:27 2017 +0200
[FFS] Don't leak on failure
CID 1363596
---
drivers/filesystems/ffs/src/block.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/filesystems/ffs/src/block.c b/drivers/filesystems/ffs/src/block.c
index 423842f51b..8507695974 100644
--- a/drivers/filesystems/ffs/src/block.c
+++ b/drivers/filesystems/ffs/src/block.c
@@ -255,6 +255,10 @@ FFSReadWriteBlocks(
(CCHAR)(Vcb->TargetDeviceObject->StackSize + 1));
if (!Irp)
{
+#ifdef __REACTOS__
+ ExFreePoolWithTag(pContext, FFS_POOL_TAG);
+ pContext = NULL;
+#endif
Status = STATUS_INSUFFICIENT_RESOURCES;
_SEH2_LEAVE;
}
@@ -268,6 +272,10 @@ FFSReadWriteBlocks(
if (!Mdl)
{
+#ifdef __REACTOS__
+ ExFreePoolWithTag(pContext, FFS_POOL_TAG);
+ pContext = NULL;
+#endif
Status = STATUS_INSUFFICIENT_RESOURCES;
_SEH2_LEAVE;
}