Check NULL pointer before access it.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Index = 0;\r
BufferSize = sizeof (EFI_HANDLE);\r
Handle = AllocateZeroPool (BufferSize);\r
+ if (Handle == NULL) {\r
+ return;\r
+ }\r
Status = gBS->LocateHandle (\r
ByProtocol,\r
&gEfiFirmwareVolume2ProtocolGuid,\r
if (EFI_BUFFER_TOO_SMALL == Status) {\r
FreePool (Handle);\r
Handle = AllocateZeroPool (BufferSize);\r
+ if (Handle == NULL) {\r
+ return;\r
+ }\r
Status = gBS->LocateHandle (\r
ByProtocol,\r
&gEfiFirmwareVolume2ProtocolGuid,\r