]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.c
BaseTools:Change the path of the file that Binary Cache
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Ip4Dxe / Ip4Icmp.c
index b4b086496cf048873a1ad3b5f6c6f4e9a6c58cad..052d6b77f79a08186f11c65f79df674049259760 100644 (file)
@@ -1,13 +1,7 @@
 /** @file\r
 \r
-Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -72,7 +66,7 @@ mIp4SupportedIcmp[23] = {
 /**\r
   Process the ICMP redirect. Find the instance then update\r
   its route cache.\r
-  \r
+\r
   All kinds of redirect is treated as host redirect as\r
   specified by RFC1122 3.3.1.2:\r
   "Since the subnet mask appropriate to the destination\r
@@ -80,7 +74,7 @@ mIp4SupportedIcmp[23] = {
   message SHOULD be treated identically to a Host Redirect\r
   message;"\r
 \r
-  @param[in]  IpSb               The IP4 service binding instance that received \r
+  @param[in]  IpSb               The IP4 service binding instance that received\r
                                  the packet.\r
   @param[in]  Head               The IP head of the received ICMPpacket.\r
   @param[in]  Packet             The content of the ICMP redirect packet with IP\r
@@ -166,7 +160,7 @@ Ip4ProcessIcmpRedirect (
   @retval EFI_SUCCESS            The ICMP error is processed successfully.\r
   @retval EFI_INVALID_PARAMETER  The packet is invalid\r
   @retval Others                 Failed to process the packet.\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 Ip4ProcessIcmpError (\r
@@ -267,6 +261,9 @@ Ip4IcmpReplyEcho (
              Ip4SysPacketSent,\r
              NULL\r
              );\r
+  if (EFI_ERROR (Status)) {\r
+    NetbufFree (Data);\r
+  }\r
 \r
 ON_EXIT:\r
   NetbufFree (Packet);\r