mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-27 07:34:06 +02:00
MdeModulePkg: Freed packet buffer when error occurs to avoid memory leak.
* In function Mtftp4WrqSendBlock(), when packet is not needed, function returns EFI_ABORTED but not freed the packet buffer. It results some memory leak and this patch is to fix this issue. Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wang Fan <fan.wang@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
This commit is contained in:
parent
39b0867d83
commit
36c19ee6c7
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Routines to process Wrq (upload).
|
Routines to process Wrq (upload).
|
||||||
|
|
||||||
Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -94,6 +94,10 @@ Mtftp4WrqSendBlock (
|
|||||||
FreePool (DataBuf);
|
FreePool (DataBuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (UdpPacket != NULL) {
|
||||||
|
NetbufFree (UdpPacket);
|
||||||
|
}
|
||||||
|
|
||||||
Mtftp4SendError (
|
Mtftp4SendError (
|
||||||
Instance,
|
Instance,
|
||||||
EFI_MTFTP4_ERRORCODE_REQUEST_DENIED,
|
EFI_MTFTP4_ERRORCODE_REQUEST_DENIED,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user