[FFS] Don't leak memory on volume mount

CID 1363583
This commit is contained in:
Pierre Schweitzer 2017-10-23 10:25:40 +02:00
parent 19bf484a5b
commit 34d74fbd17

View file

@ -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;
}