mirror of https://github.com/acidanthera/audk.git
Fix a bug introduced when removing the SafeFreePool. Pointer should be checked before FreePool.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6349 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
f7763aa493
commit
c473cc1756
|
@ -305,7 +305,9 @@ BdsLibRegisterNewOption (
|
||||||
// Got the option, so just return
|
// Got the option, so just return
|
||||||
//
|
//
|
||||||
FreePool (OptionPtr);
|
FreePool (OptionPtr);
|
||||||
FreePool (TempOptionPtr);
|
if (TempOptionPtr != NULL) {
|
||||||
|
FreePool (TempOptionPtr);
|
||||||
|
}
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
} else {
|
} else {
|
||||||
//
|
//
|
||||||
|
@ -364,7 +366,9 @@ BdsLibRegisterNewOption (
|
||||||
//
|
//
|
||||||
if (EFI_ERROR (Status) || UpdateDescription) {
|
if (EFI_ERROR (Status) || UpdateDescription) {
|
||||||
FreePool (OptionPtr);
|
FreePool (OptionPtr);
|
||||||
FreePool (TempOptionPtr);
|
if (TempOptionPtr != NULL) {
|
||||||
|
FreePool (TempOptionPtr);
|
||||||
|
}
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -386,7 +390,9 @@ BdsLibRegisterNewOption (
|
||||||
sizeof (UINT16),
|
sizeof (UINT16),
|
||||||
&BootOrderEntry
|
&BootOrderEntry
|
||||||
);
|
);
|
||||||
FreePool (TempOptionPtr);
|
if (TempOptionPtr != NULL) {
|
||||||
|
FreePool (TempOptionPtr);
|
||||||
|
}
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue