]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Wrq.c
MdeModulePkg: Freed packet buffer when error occurs to avoid memory leak.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Mtftp4Dxe / Mtftp4Wrq.c
index e8257147006bff793a58e9f3d772e26c07bb5f6f..438659a76e762965bfc271be6f2b0fb3dbfc6d39 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Routines to process Wrq (upload).\r
   \r
-Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2018, 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
@@ -94,6 +94,10 @@ Mtftp4WrqSendBlock (
         FreePool (DataBuf);\r
       }\r
 \r
+      if (UdpPacket != NULL) {\r
+        NetbufFree (UdpPacket);\r
+      }\r
+\r
       Mtftp4SendError (\r
         Instance,\r
         EFI_MTFTP4_ERRORCODE_REQUEST_DENIED,\r