From 24ed9cfd23b005511fb1b4007b7522927e86430a Mon Sep 17 00:00:00 2001 From: Wang Fan Date: Wed, 3 Jan 2018 17:35:53 +0800 Subject: NetworkPkg: Fix a memory leak issue in UDP6 driver In UDP6Dxe Udp6Groups(), the code return directly without free the buffer allocated for McastIp when JoinFlag is TRUE. It is a memory leak issue that needs to be fixed. This patch is to fix this issue. Cc: Ye Ting Cc: Jiaxin Wu Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wang Fan Reviewed-by: Jiaxin Wu --- NetworkPkg/Udp6Dxe/Udp6Main.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'NetworkPkg/Udp6Dxe') diff --git a/NetworkPkg/Udp6Dxe/Udp6Main.c b/NetworkPkg/Udp6Dxe/Udp6Main.c index 9105ef453f..8495bc332a 100644 --- a/NetworkPkg/Udp6Dxe/Udp6Main.c +++ b/NetworkPkg/Udp6Dxe/Udp6Main.c @@ -351,6 +351,9 @@ Udp6Groups ( Instance = UDP6_INSTANCE_DATA_FROM_THIS (This); if (!Instance->Configured) { + if (McastIp != NULL) { + FreePool (McastIp); + } return EFI_NOT_STARTED; } -- cgit v1.2.3