//\r
EfiVarStoreList = ReallocatePool (EfiVarStoreMaxNum * sizeof (UINTN), (EfiVarStoreMaxNum + BASE_NUMBER) * sizeof (UINTN), EfiVarStoreList);\r
if (EfiVarStoreList == NULL) {\r
- break;\r
+ goto Done;\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
- break;\r
+ goto Done;\r
}\r
DefaultIdMaxNum = DefaultIdMaxNum + BASE_NUMBER;\r
}\r
}\r
\r
Done:\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
}\r
return;\r
}\r