Functions implementation related with DHCPv6 for UefiPxeBc Driver.\r
\r
(C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>\r
- Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
if (ModeStr != NULL && *(ModeStr + AsciiStrLen (";mode=octet")) == '\0') {\r
*ModeStr = '\0';\r
} else if (AsciiStrStr (BootFileNamePtr, ";mode=") != NULL) {\r
+ FreePool (TmpStr);\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
);\r
\r
if (EFI_ERROR (Status)) {\r
- return Status;\r
+ goto ON_ERROR;\r
}\r
\r
//\r
//\r
Status = Private->Udp6Read->Configure (Private->Udp6Read, &Private->Udp6CfgData);\r
if (EFI_ERROR (Status)) {\r
- return Status;\r
+ goto ON_ERROR;\r
}\r
\r
Status = PxeBc->UdpRead (\r
Private->Udp6Read->Configure (Private->Udp6Read, NULL);\r
\r
if (EFI_ERROR (Status)) {\r
- return Status;\r
+ goto ON_ERROR;\r
}\r
\r
//\r
Reply->Length = (UINT32) ReadSize;\r
\r
return EFI_SUCCESS;\r
+ \r
+ON_ERROR:\r
+ if (Discover != NULL) {\r
+ FreePool (Discover);\r
+ }\r
+\r
+ return Status;\r
}\r
\r
\r
SelectAd = &Private->OfferBuffer[Private->SelectIndex - 1].Dhcp6.Packet.Offer;\r
*NewPacket = AllocateZeroPool (SelectAd->Size);\r
ASSERT (*NewPacket != NULL);\r
+ if (*NewPacket == NULL) {\r
+ return EFI_ABORTED;\r
+ }\r
CopyMem (*NewPacket, SelectAd, SelectAd->Size);\r
}\r
break;\r
(VOID *) Discover\r
);\r
if (EFI_ERROR (Status)) {\r
- return Status;\r
+ goto ON_ERROR;\r
}\r
\r
//\r
//\r
Status = Private->Udp6Read->Configure (Private->Udp6Read, &Private->Udp6CfgData);\r
if (EFI_ERROR (Status)) {\r
- return Status;\r
+ goto ON_ERROR;\r
}\r
\r
Status = PxeBc->UdpRead (\r
//\r
Private->Udp6Read->Configure (Private->Udp6Read, NULL);\r
if (EFI_ERROR (Status)) {\r
- return Status;\r
+ goto ON_ERROR;\r
}\r
\r
return EFI_SUCCESS;\r
+\r
+ON_ERROR:\r
+ if (Discover != NULL) {\r
+ FreePool (Discover);\r
+ }\r
+\r
+ return Status;\r
}\r
\r
\r