NetworkPkg: Replace ASSERT with error handling in Http boot and IScsi
v2: *Fix some memory leak issue. This patch is used to replace ASSERT with error handling in Http boot Driver and IScsi driver. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Wu Jiaxin <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com>
This commit is contained in:
@@ -273,7 +273,9 @@ HttpBootFormExtractConfig (
|
||||
ConfigRequestHdr = HiiConstructConfigHdr (&gHttpBootConfigGuid, mHttpBootConfigStorageName, CallbackInfo->ChildHandle);
|
||||
Size = (StrLen (ConfigRequestHdr) + 32 + 1) * sizeof (CHAR16);
|
||||
ConfigRequest = AllocateZeroPool (Size);
|
||||
ASSERT (ConfigRequest != NULL);
|
||||
if (ConfigRequest == NULL) {
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
AllocatedRequest = TRUE;
|
||||
UnicodeSPrint (ConfigRequest, Size, L"%s&OFFSET=0&WIDTH=%016LX", ConfigRequestHdr, (UINT64)BufferSize);
|
||||
FreePool (ConfigRequestHdr);
|
||||
@@ -464,7 +466,6 @@ HttpBootFormCallback (
|
||||
// Get user input URI string
|
||||
//
|
||||
Uri = HiiGetString (CallbackInfo->RegisteredHandle, Value->string, NULL);
|
||||
ASSERT (Uri != NULL);
|
||||
if (Uri == NULL) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
Reference in New Issue
Block a user