mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-11-10 09:40:53 +01:00
fix memory leaks
Signed-off-by: Sergey Isakov <isakov-sl@bk.ru>
This commit is contained in:
parent
a9207a9305
commit
80c5b67d7e
@ -767,6 +767,7 @@ ApfsDriverLoaderStart (
|
||||
DEBUG ((DEBUG_VERBOSE, "ObjectType: %04x\n", ContainerSuperBlock->BlockHeader.ObjectType ));
|
||||
if (ContainerSuperBlock->BlockHeader.ObjectOid != 1
|
||||
|| ContainerSuperBlock->BlockHeader.ObjectType != 0x80000001) {
|
||||
FreePool(ApfsBlock);
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
@ -810,6 +811,7 @@ ApfsDriverLoaderStart (
|
||||
|
||||
//
|
||||
// Free ApfsBlock and allocate one of a correct size.
|
||||
// ContainerSuperBlock & EfiBootRecordBlockPtr will not valid now
|
||||
//
|
||||
FreePool (ApfsBlock);
|
||||
ApfsBlock = AllocateZeroPool (ApfsBlockSize);
|
||||
@ -954,6 +956,7 @@ ApfsDriverLoaderStart (
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
FreePool(EfiFileBuffer);
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
//
|
||||
@ -992,6 +995,9 @@ ApfsDriverLoaderStart (
|
||||
Private = AllocatePool (sizeof (APFS_DRIVER_INFO_PRIVATE_DATA));
|
||||
if (Private == NULL) {
|
||||
FreePool (ApfsBlock);
|
||||
if (EfiFileBuffer) {
|
||||
FreePool(EfiFileBuffer);
|
||||
}
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user