]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/Mtftp6Dxe/Mtftp6Support.c
MdeModulePkg-DxeCore: rename CoreGetMemoryMapPropertiesTable
[mirror_edk2.git] / NetworkPkg / Mtftp6Dxe / Mtftp6Support.c
index 20888e8525e8d154258272e3732a9fd2733aeb6a..64df901d60d81a940c49f79d1e301e78bd73507d 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Mtftp6 support functions implementation.\r
 \r
 /** @file\r
   Mtftp6 support functions implementation.\r
 \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
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -319,6 +319,29 @@ Mtftp6GetMapping (
     Status = Udp6->GetModeData (Udp6, NULL, &Ip6Mode, NULL, NULL);\r
 \r
     if (!EFI_ERROR (Status)) {\r
     Status = Udp6->GetModeData (Udp6, NULL, &Ip6Mode, NULL, NULL);\r
 \r
     if (!EFI_ERROR (Status)) {\r
+      if (Ip6Mode.AddressList != NULL) {\r
+        FreePool (Ip6Mode.AddressList);\r
+      }\r
+\r
+      if (Ip6Mode.GroupTable != NULL) {\r
+        FreePool (Ip6Mode.GroupTable);\r
+      }\r
+\r
+      if (Ip6Mode.RouteTable != NULL) {\r
+        FreePool (Ip6Mode.RouteTable);\r
+      }\r
+\r
+      if (Ip6Mode.NeighborCache != NULL) {\r
+        FreePool (Ip6Mode.NeighborCache);\r
+      }\r
+\r
+      if (Ip6Mode.PrefixTable != NULL) {\r
+        FreePool (Ip6Mode.PrefixTable);\r
+      }\r
+\r
+      if (Ip6Mode.IcmpTypeList != NULL) {\r
+        FreePool (Ip6Mode.IcmpTypeList);\r
+      }\r
 \r
       if  (Ip6Mode.IsConfigured) {\r
         //\r
 \r
       if  (Ip6Mode.IsConfigured) {\r
         //\r
@@ -602,7 +625,7 @@ Mtftp6SendError (
   TftpError->OpCode          = HTONS (EFI_MTFTP6_OPCODE_ERROR);\r
   TftpError->Error.ErrorCode = HTONS (ErrCode);\r
 \r
   TftpError->OpCode          = HTONS (EFI_MTFTP6_OPCODE_ERROR);\r
   TftpError->Error.ErrorCode = HTONS (ErrCode);\r
 \r
-  AsciiStrCpyS ((CHAR8 *) TftpError->Error.ErrorMessage, sizeof (TftpError->Error.ErrorMessage) / sizeof (TftpError->Error.ErrorMessage[0]), (CHAR8 *) ErrInfo);\r
+  AsciiStrCpyS ((CHAR8 *) TftpError->Error.ErrorMessage, AsciiStrLen ((CHAR8 *) ErrInfo) + 1 , (CHAR8 *) ErrInfo);\r
 \r
   //\r
   // Save the packet buf for retransmit\r
 \r
   //\r
   // Save the packet buf for retransmit\r