MdeModulePkg/Dhcp4Dxe: Free NET_BUF data after sent out to avoid memory leak
* When build a DHCP message in function DhcpSendMessage() or DhcpRetransmit(), a new NET_BUF is created by the library of NetbufFromExt, but it's not freed after it is sent out. This patch is to fix this memory leak issue. V2: * Since packet has already been referred by DhcpSb->LastPacket, and will be freed when sending another packet or clean up, there is no need to add an extra free function in NetbufFromExt. 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: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
RFC 1534: Interoperation Between DHCP and BOOTP
|
||||
RFC 3396: Encoding Long Options in DHCP.
|
||||
|
||||
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
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
|
||||
@@ -184,6 +184,18 @@ DhcpCleanConfigure (
|
||||
IN OUT EFI_DHCP4_CONFIG_DATA *Config
|
||||
);
|
||||
|
||||
/**
|
||||
Callback of Dhcp packet. Does nothing.
|
||||
|
||||
@param Arg The context.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
DhcpDummyExtFree (
|
||||
IN VOID *Arg
|
||||
);
|
||||
|
||||
/**
|
||||
Set the elapsed time based on the given instance and the pointer to the
|
||||
elapsed time option.
|
||||
|
Reference in New Issue
Block a user