https://git.reactos.org/?p=reactos.git;a=commitdiff;h=34d74fbd17ce6046c3633…
commit 34d74fbd17ce6046c363301df9e67444c205529f
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Mon Oct 23 10:25:40 2017 +0200
[FFS] Don't leak memory on volume mount
CID 1363583
---
drivers/filesystems/ffs/src/fsctl.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/drivers/filesystems/ffs/src/fsctl.c b/drivers/filesystems/ffs/src/fsctl.c
index 251ea88b83..175b325820 100644
--- a/drivers/filesystems/ffs/src/fsctl.c
+++ b/drivers/filesystems/ffs/src/fsctl.c
@@ -183,6 +183,9 @@ FFSLoadDiskLabel(
Vcb->FSOffset[0] = 0;
Vcb->PartitionNumber = 0;
Vcb->ffs_super_block = FFSSb;
+#ifdef __REACTOS__
+ ExFreePoolWithTag(Disklabel, FFS_POOL_TAG);
+#endif
Status = STATUS_SUCCESS;
return Status;
}
@@ -202,12 +205,18 @@ FFSLoadDiskLabel(
Vcb->FSOffset[0] = 0;
Vcb->PartitionNumber = 0;
Vcb->ffs_super_block = FFSSb;
+#ifdef __REACTOS__
+ ExFreePoolWithTag(Disklabel, FFS_POOL_TAG);
+#endif
Status = STATUS_SUCCESS;
return Status;
}
else
{
KdPrint(("FFSLoadDiskLabel() No BSD file system was found on the
\"normal\" partition.\n"));
+#ifdef __REACTOS__
+ ExFreePoolWithTag(Disklabel, FFS_POOL_TAG);
+#endif
Status = STATUS_UNRECOGNIZED_VOLUME;
return Status;
}
@@ -217,6 +226,9 @@ FFSLoadDiskLabel(
if (!NT_SUCCESS(Status))
{
KdPrint(("FFSLoadDiskLabel() Slice info failed, Status %u\n", Status));
+#ifdef __REACTOS__
+ ExFreePoolWithTag(Disklabel, FFS_POOL_TAG);
+#endif
return Status;
}
@@ -303,6 +315,10 @@ FFSLoadDiskLabel(
if (Vcb->ffs_super_block == NULL)
Status = STATUS_UNRECOGNIZED_VOLUME;
+#ifdef __REACTOS__
+ ExFreePoolWithTag(Disklabel, FFS_POOL_TAG);
+#endif
+
return Status;
}