summaryrefslogtreecommitdiffstats
path: root/NetworkPkg/DnsDxe
diff options
context:
space:
mode:
Diffstat (limited to 'NetworkPkg/DnsDxe')
-rw-r--r--NetworkPkg/DnsDxe/ComponentName.c16
-rw-r--r--NetworkPkg/DnsDxe/DnsImpl.c34
2 files changed, 44 insertions, 6 deletions
diff --git a/NetworkPkg/DnsDxe/ComponentName.c b/NetworkPkg/DnsDxe/ComponentName.c
index d95ed92d8a..d976bc6849 100644
--- a/NetworkPkg/DnsDxe/ComponentName.c
+++ b/NetworkPkg/DnsDxe/ComponentName.c
@@ -1,7 +1,7 @@
/** @file
Implementation of EFI_COMPONENT_NAME_PROTOCOL and EFI_COMPONENT_NAME2_PROTOCOL protocol.
-Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 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
which accompanies this distribution. The full text of the license may be found at
@@ -211,6 +211,13 @@ UpdateDns4Name (
ModeData.DnsConfigData.LocalPort
);
+ if (ModeData.DnsCacheList != NULL) {
+ FreePool (ModeData.DnsCacheList);
+ }
+ if (ModeData.DnsServerList != NULL) {
+ FreePool (ModeData.DnsServerList);
+ }
+
if (gDnsControllerNameTable != NULL) {
FreeUnicodeStringTable (gDnsControllerNameTable);
gDnsControllerNameTable = NULL;
@@ -281,6 +288,13 @@ UpdateDns6Name (
ModeData.DnsConfigData.LocalPort
);
+ if (ModeData.DnsCacheList != NULL) {
+ FreePool (ModeData.DnsCacheList);
+ }
+ if (ModeData.DnsServerList != NULL) {
+ FreePool (ModeData.DnsServerList);
+ }
+
if (gDnsControllerNameTable != NULL) {
FreeUnicodeStringTable (gDnsControllerNameTable);
gDnsControllerNameTable = NULL;
diff --git a/NetworkPkg/DnsDxe/DnsImpl.c b/NetworkPkg/DnsDxe/DnsImpl.c
index 71daccea80..617e623286 100644
--- a/NetworkPkg/DnsDxe/DnsImpl.c
+++ b/NetworkPkg/DnsDxe/DnsImpl.c
@@ -1,7 +1,7 @@
/** @file
DnsDxe support functions implementation.
-Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 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
which accompanies this distribution. The full text of the license may be found at
@@ -618,11 +618,35 @@ Dns6GetMapping (
while (!EFI_ERROR (gBS->CheckEvent (Service->TimerToGetMap))) {
Udp->Poll (Udp);
- if (!EFI_ERROR (Udp->GetModeData (Udp, NULL, &Ip6Mode, NULL, NULL)) &&
- Ip6Mode.IsConfigured) {
+ if (!EFI_ERROR (Udp->GetModeData (Udp, NULL, &Ip6Mode, NULL, NULL))) {
+ if (Ip6Mode.AddressList != NULL) {
+ FreePool (Ip6Mode.AddressList);
+ }
- Udp->Configure (Udp, NULL);
- return (BOOLEAN) (Udp->Configure (Udp, UdpCfgData) == EFI_SUCCESS);
+ if (Ip6Mode.GroupTable != NULL) {
+ FreePool (Ip6Mode.GroupTable);
+ }
+
+ if (Ip6Mode.RouteTable != NULL) {
+ FreePool (Ip6Mode.RouteTable);
+ }
+
+ if (Ip6Mode.NeighborCache != NULL) {
+ FreePool (Ip6Mode.NeighborCache);
+ }
+
+ if (Ip6Mode.PrefixTable != NULL) {
+ FreePool (Ip6Mode.PrefixTable);
+ }
+
+ if (Ip6Mode.IcmpTypeList != NULL) {
+ FreePool (Ip6Mode.IcmpTypeList);
+ }
+
+ if (Ip6Mode.IsConfigured) {
+ Udp->Configure (Udp, NULL);
+ return (BOOLEAN) (Udp->Configure (Udp, UdpCfgData) == EFI_SUCCESS);
+ }
}
}