]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c
MdeModulePkg-DxeCore: rename CoreGetMemoryMapPropertiesTable
[mirror_edk2.git] / NetworkPkg / UefiPxeBcDxe / PxeBcDhcp6.c
index 6ad5f5f1ac9fd5eb318a3fcd55e597d13e92dbd7..8003f314910ef015dfa032dbe61a94ffadbcbdf8 100644 (file)
@@ -2,7 +2,7 @@
   Functions implementation related with DHCPv6 for UefiPxeBc Driver.\r
 \r
   (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>\r
-  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2016, 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
@@ -2073,7 +2073,7 @@ PxeBcDhcp6Sarr (
     return Status;\r
   }\r
 \r
-  ASSERT (Mode.Ia->State == Dhcp6Bound);\r
+  ASSERT ((Mode.Ia != NULL) && (Mode.Ia->State == Dhcp6Bound));\r
   //\r
   // DHCP6 doesn't have an option to specify the router address on the subnet, the only way to get the\r
   // router address in IP6 is the router discovery mechanism (the RS and RA, which only be handled when\r
@@ -2082,7 +2082,12 @@ PxeBcDhcp6Sarr (
   // to find a valid router address.\r
   //\r
   CopyMem (&Private->TmpStationIp.v6, &Mode.Ia->IaAddress[0].IpAddress, sizeof (EFI_IPv6_ADDRESS));\r
-\r
+  if (Mode.ClientId != NULL) {\r
+    FreePool (Mode.ClientId);\r
+  }\r
+  if (Mode.Ia != NULL) {\r
+    FreePool (Mode.Ia);\r
+  }\r
   //\r
   // Check the selected offer whether BINL retry is needed.\r
   //\r