mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-27 15:44:04 +02:00
MdeModulePkg HiiDataBase: Fix the potential NULL pointer reference
This change is the additional fix of commit 14b351e2ed8586f144dd3cd2e0a25082c1a32837. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
parent
56d0bd7eb8
commit
9eefa2eca0
@ -845,7 +845,7 @@ UpdateDefaultSettingInFormPackage (
|
|||||||
//
|
//
|
||||||
EfiVarStoreList = ReallocatePool (EfiVarStoreMaxNum * sizeof (UINTN), (EfiVarStoreMaxNum + BASE_NUMBER) * sizeof (UINTN), EfiVarStoreList);
|
EfiVarStoreList = ReallocatePool (EfiVarStoreMaxNum * sizeof (UINTN), (EfiVarStoreMaxNum + BASE_NUMBER) * sizeof (UINTN), EfiVarStoreList);
|
||||||
if (EfiVarStoreList == NULL) {
|
if (EfiVarStoreList == NULL) {
|
||||||
break;
|
goto Done;
|
||||||
}
|
}
|
||||||
EfiVarStoreMaxNum = EfiVarStoreMaxNum + BASE_NUMBER;
|
EfiVarStoreMaxNum = EfiVarStoreMaxNum + BASE_NUMBER;
|
||||||
}
|
}
|
||||||
@ -874,7 +874,7 @@ UpdateDefaultSettingInFormPackage (
|
|||||||
//
|
//
|
||||||
DefaultIdList = ReallocatePool (DefaultIdMaxNum * sizeof (UINT16), (DefaultIdMaxNum + BASE_NUMBER) * sizeof (UINT16), DefaultIdList);
|
DefaultIdList = ReallocatePool (DefaultIdMaxNum * sizeof (UINT16), (DefaultIdMaxNum + BASE_NUMBER) * sizeof (UINT16), DefaultIdList);
|
||||||
if (DefaultIdList == NULL) {
|
if (DefaultIdList == NULL) {
|
||||||
break;
|
goto Done;
|
||||||
}
|
}
|
||||||
DefaultIdMaxNum = DefaultIdMaxNum + BASE_NUMBER;
|
DefaultIdMaxNum = DefaultIdMaxNum + BASE_NUMBER;
|
||||||
}
|
}
|
||||||
@ -1046,9 +1046,11 @@ UpdateDefaultSettingInFormPackage (
|
|||||||
}
|
}
|
||||||
|
|
||||||
Done:
|
Done:
|
||||||
|
if (EfiVarStoreList != NULL) {
|
||||||
for (Index = 0; Index < EfiVarStoreNumber; Index ++) {
|
for (Index = 0; Index < EfiVarStoreNumber; Index ++) {
|
||||||
FreePool (EfiVarStoreList [Index]);
|
FreePool (EfiVarStoreList [Index]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user