From: fanwang2 <fan.wang@intel.com>
To: edk2-devel@lists.01.org
Cc: Wang Fan <fan.wang@intel.com>, Ye Ting <ting.ye@intel.com>,
Jiaxin Wu <jiaxin.wu@intel.com>, Fu Siyuan <siyuan.fu@intel.com>
Subject: [Patch 2/4] NetworkPkg: Fix a memory leak issue in UDP6 driver
Date: Thu, 4 Jan 2018 11:20:06 +0800 [thread overview]
Message-ID: <1515036008-10700-3-git-send-email-fan.wang@intel.com> (raw)
In-Reply-To: <1515036008-10700-1-git-send-email-fan.wang@intel.com>
From: Wang Fan <fan.wang@intel.com>
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>
---
NetworkPkg/Udp6Dxe/Udp6Main.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/NetworkPkg/Udp6Dxe/Udp6Main.c b/NetworkPkg/Udp6Dxe/Udp6Main.c
index 9105ef4..8495bc3 100644
--- a/NetworkPkg/Udp6Dxe/Udp6Main.c
+++ b/NetworkPkg/Udp6Dxe/Udp6Main.c
@@ -349,10 +349,13 @@ Udp6Groups (
}
}
Instance = UDP6_INSTANCE_DATA_FROM_THIS (This);
if (!Instance->Configured) {
+ if (McastIp != NULL) {
+ FreePool (McastIp);
+ }
return EFI_NOT_STARTED;
}
Ip = Instance->IpInfo->Ip.Ip6;
--
1.9.5.msysgit.1
next prev parent reply other threads:[~2018-01-04 3:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-04 3:20 [Patch 0/4] Fix some issues in Udp6Dxe fanwang2
2018-01-04 3:20 ` [Patch 1/4] NetworkPkg: Add ASSERT error handling for UDP6 driver fanwang2
2018-01-04 3:20 ` fanwang2 [this message]
2018-01-04 3:20 ` [Patch 3/4] NetworkPkg: Fix some coding style issues in " fanwang2
2018-01-04 3:20 ` [Patch 4/4] NetworkPkg: Add more parameter or return status check " fanwang2
2018-01-11 5:37 ` [Patch 0/4] Fix some issues in Udp6Dxe Wu, Jiaxin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1515036008-10700-3-git-send-email-fan.wang@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox