//\r
if (Question->QuestionReferToBitField) {\r
Buffer = (UINT8 *)AllocateZeroPool (Question->StorageWidth);\r
- ASSERT (Buffer != NULL);\r
+ if (Buffer == NULL) {\r
+ return EFI_OUT_OF_RESOURCES;\r
+ }\r
Dst = Buffer;\r
} else {\r
Dst = (UINT8 *) &Question->HiiValue.Value;\r
\r
*StringPtr = TempChar;\r
\r
- if (Question->QuestionReferToBitField) {\r
+ if (Buffer != NULL && Question->QuestionReferToBitField) {\r
GetBitsQuestionValue (Question, Buffer);\r
- if (Buffer != NULL) {\r
- FreePool (Buffer);\r
- }\r
+ FreePool (Buffer);\r
}\r
\r
return Status;\r