summaryrefslogtreecommitdiffstats
path: root/NetworkPkg/Udp6Dxe
diff options
context:
space:
mode:
authorWang Fan <fan.wang@intel.com>2018-01-03 17:35:53 +0800
committerFu Siyuan <siyuan.fu@intel.com>2018-01-11 17:08:31 +0800
commit24ed9cfd23b005511fb1b4007b7522927e86430a (patch)
tree5792eb20160b7d1eb44cb9088c3f2c48a6246d54 /NetworkPkg/Udp6Dxe
parent2c4a45b3619303112d46df0d5a606842ad32d011 (diff)
downloadedk2-24ed9cfd23b005511fb1b4007b7522927e86430a.tar.gz
edk2-24ed9cfd23b005511fb1b4007b7522927e86430a.tar.bz2
edk2-24ed9cfd23b005511fb1b4007b7522927e86430a.zip
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 <ting.ye@intel.com> Cc: Jiaxin Wu <jiaxin.wu@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>
Diffstat (limited to 'NetworkPkg/Udp6Dxe')
-rw-r--r--NetworkPkg/Udp6Dxe/Udp6Main.c3
1 files changed, 3 insertions, 0 deletions
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;
}