summaryrefslogtreecommitdiff
path: root/NetworkPkg/IpSecDxe
diff options
context:
space:
mode:
authorZhang Lubo <lubo.zhang@intel.com>2016-01-28 02:32:43 +0000
committerluobozhang <luobozhang@Edk2>2016-01-28 02:32:43 +0000
commitce22514e4800dca7854a4778a66e8f08d2b18345 (patch)
tree8ccf7fa35b104abc4121e0009a4fdecce5bde0e5 /NetworkPkg/IpSecDxe
parentb1b1d6469964b61e710b08f25cbf01a7156d2ea5 (diff)
downloadedk2-platforms-ce22514e4800dca7854a4778a66e8f08d2b18345.tar.xz
NetworkPkg:Fix Network memory leak when calling GetModeData interface
Multiple network protocols have a GetModeData() interface, which may allocate memory resource in the return mode data structure. It's callers responsibility to free these buffers. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19758 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'NetworkPkg/IpSecDxe')
-rw-r--r--NetworkPkg/IpSecDxe/IkeService.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/NetworkPkg/IpSecDxe/IkeService.c b/NetworkPkg/IpSecDxe/IkeService.c
index d8571960a0..4c0f6f5eb1 100644
--- a/NetworkPkg/IpSecDxe/IkeService.c
+++ b/NetworkPkg/IpSecDxe/IkeService.c
@@ -1,7 +1,7 @@
/** @file
Provide IPsec Key Exchange (IKE) service general interfaces.
- Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2010 - 2016, 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
@@ -328,6 +328,31 @@ IkeOpenOutputUdp (
UdpIoFreeIo (UdpService->Output);
goto ON_EXIT;
}
+
+ if (Ip6ModeData.AddressList != NULL) {
+ FreePool (Ip6ModeData.AddressList);
+ }
+
+ if (Ip6ModeData.GroupTable != NULL) {
+ FreePool (Ip6ModeData.GroupTable);
+ }
+
+ if (Ip6ModeData.RouteTable != NULL) {
+ FreePool (Ip6ModeData.RouteTable);
+ }
+
+ if (Ip6ModeData.NeighborCache != NULL) {
+ FreePool (Ip6ModeData.NeighborCache);
+ }
+
+ if (Ip6ModeData.PrefixTable != NULL) {
+ FreePool (Ip6ModeData.PrefixTable);
+ }
+
+ if (Ip6ModeData.IcmpTypeList != NULL) {
+ FreePool (Ip6ModeData.IcmpTypeList);
+ }
+
//
// Reconfigure udp6 io without remote address.
//