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>
//\r
EfiVarStoreList = ReallocatePool (EfiVarStoreMaxNum * sizeof (UINTN), (EfiVarStoreMaxNum + BASE_NUMBER) * sizeof (UINTN), EfiVarStoreList);\r
if (EfiVarStoreList == NULL) {\r
//\r
EfiVarStoreList = ReallocatePool (EfiVarStoreMaxNum * sizeof (UINTN), (EfiVarStoreMaxNum + BASE_NUMBER) * sizeof (UINTN), EfiVarStoreList);\r
if (EfiVarStoreList == NULL) {\r
}\r
EfiVarStoreMaxNum = EfiVarStoreMaxNum + BASE_NUMBER;\r
}\r
}\r
EfiVarStoreMaxNum = EfiVarStoreMaxNum + BASE_NUMBER;\r
}\r
//\r
DefaultIdList = ReallocatePool (DefaultIdMaxNum * sizeof (UINT16), (DefaultIdMaxNum + BASE_NUMBER) * sizeof (UINT16), DefaultIdList);\r
if (DefaultIdList == NULL) {\r
//\r
DefaultIdList = ReallocatePool (DefaultIdMaxNum * sizeof (UINT16), (DefaultIdMaxNum + BASE_NUMBER) * sizeof (UINT16), DefaultIdList);\r
if (DefaultIdList == NULL) {\r
}\r
DefaultIdMaxNum = DefaultIdMaxNum + BASE_NUMBER;\r
}\r
}\r
DefaultIdMaxNum = DefaultIdMaxNum + BASE_NUMBER;\r
}\r
- for (Index = 0; Index < EfiVarStoreNumber; Index ++) {\r
- FreePool (EfiVarStoreList [Index]);\r
+ if (EfiVarStoreList != NULL) {\r
+ for (Index = 0; Index < EfiVarStoreNumber; Index ++) {\r
+ FreePool (EfiVarStoreList [Index]);\r
+ }\r