diff options
author | Liming Gao <liming.gao@intel.com> | 2017-12-27 10:31:19 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2017-12-27 17:40:45 +0800 |
commit | 9eefa2eca070255762b75cae4cca41b8ba537202 (patch) | |
tree | a6bfdaa942f0946fbbad4a43692874fb8f4d070f /MdeModulePkg/Universal/HiiDatabaseDxe | |
parent | 56d0bd7eb8e08a7a9c47edb8a2483781359cac65 (diff) | |
download | edk2-9eefa2eca070255762b75cae4cca41b8ba537202.zip edk2-9eefa2eca070255762b75cae4cca41b8ba537202.tar.gz edk2-9eefa2eca070255762b75cae4cca41b8ba537202.tar.bz2 |
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>
Diffstat (limited to 'MdeModulePkg/Universal/HiiDatabaseDxe')
-rw-r--r-- | MdeModulePkg/Universal/HiiDatabaseDxe/Database.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c index c10134b..4a2dc8d 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c @@ -845,7 +845,7 @@ UpdateDefaultSettingInFormPackage ( //
EfiVarStoreList = ReallocatePool (EfiVarStoreMaxNum * sizeof (UINTN), (EfiVarStoreMaxNum + BASE_NUMBER) * sizeof (UINTN), EfiVarStoreList);
if (EfiVarStoreList == NULL) {
- break;
+ goto Done;
}
EfiVarStoreMaxNum = EfiVarStoreMaxNum + BASE_NUMBER;
}
@@ -874,7 +874,7 @@ UpdateDefaultSettingInFormPackage ( //
DefaultIdList = ReallocatePool (DefaultIdMaxNum * sizeof (UINT16), (DefaultIdMaxNum + BASE_NUMBER) * sizeof (UINT16), DefaultIdList);
if (DefaultIdList == NULL) {
- break;
+ goto Done;
}
DefaultIdMaxNum = DefaultIdMaxNum + BASE_NUMBER;
}
@@ -1046,8 +1046,10 @@ UpdateDefaultSettingInFormPackage ( }
Done:
- for (Index = 0; Index < EfiVarStoreNumber; Index ++) {
- FreePool (EfiVarStoreList [Index]);
+ if (EfiVarStoreList != NULL) {
+ for (Index = 0; Index < EfiVarStoreNumber; Index ++) {
+ FreePool (EfiVarStoreList [Index]);
+ }
}
return;
}
|