]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/HttpBootDxe/HttpBootDhcp6.c
NetworkPkg:Fix Network memory leak when calling GetModeData interface
[mirror_edk2.git] / NetworkPkg / HttpBootDxe / HttpBootDhcp6.c
index e5cf894714e1a75dd501e9c769748f297b91546b..2538bd116ca42ddb47c2081c4fab3e03c0399766 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Functions implementation related with DHCPv6 for HTTP boot driver.\r
 \r
-Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials are licensed and made available under \r
 the terms and conditions of the BSD License that accompanies this distribution.  \r
 The full text of the license may be found at\r
@@ -974,8 +974,13 @@ ON_EXIT:
     Dhcp6->Configure (Dhcp6, NULL);\r
   } else {\r
     ZeroMem (&Config, sizeof (EFI_DHCP6_CONFIG_DATA));\r
-    ZeroMem (&Mode, sizeof (EFI_DHCP6_MODE_DATA));\r
     Dhcp6->Configure (Dhcp6, &Config);\r
+    if (Mode.ClientId != NULL) {\r
+      FreePool (Mode.ClientId);\r
+    }\r
+    if (Mode.Ia != NULL) {\r
+      FreePool (Mode.Ia);\r
+    }\r
   }\r
 \r
   return Status; \r