summaryrefslogtreecommitdiffstats
path: root/NetworkPkg/DnsDxe
diff options
context:
space:
mode:
authorZhang Lubo <lubo.zhang@intel.com>2016-10-14 14:51:24 +0800
committerJiaxin Wu <jiaxin.wu@intel.com>2016-10-26 16:43:00 +0800
commit8aa2cdd79f9c75429ae1c23ac0f379d901a251d6 (patch)
tree92c925866ec8b03349292d7c16f91aee28541ab2 /NetworkPkg/DnsDxe
parent6692d5195477e2fb2f99159745e7a14814e56c3e (diff)
downloadedk2-8aa2cdd79f9c75429ae1c23ac0f379d901a251d6.tar.gz
edk2-8aa2cdd79f9c75429ae1c23ac0f379d901a251d6.tar.bz2
edk2-8aa2cdd79f9c75429ae1c23ac0f379d901a251d6.zip
NetworkPkg: Enhance the code in DNS driver.
There may be an error happens when we use the configure function to set or change the configuration data for the DNS6 instance, So we will free the DnsServerList without configured to NULL. If we reset the instance with the parameter DnsConfigData to NULL, the DnsServerList will be freed twice. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
Diffstat (limited to 'NetworkPkg/DnsDxe')
-rw-r--r--NetworkPkg/DnsDxe/DnsProtocol.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/NetworkPkg/DnsDxe/DnsProtocol.c b/NetworkPkg/DnsDxe/DnsProtocol.c
index 64fca6a55b..6d117b2892 100644
--- a/NetworkPkg/DnsDxe/DnsProtocol.c
+++ b/NetworkPkg/DnsDxe/DnsProtocol.c
@@ -287,6 +287,7 @@ Dns4Configure (
if (EFI_ERROR (Status)) {
if (Instance->Dns4CfgData.DnsServerList != NULL) {
FreePool (Instance->Dns4CfgData.DnsServerList);
+ Instance->Dns4CfgData.DnsServerList = NULL;
}
goto ON_EXIT;
}
@@ -298,6 +299,7 @@ Dns4Configure (
if (EFI_ERROR (Status)) {
if (Instance->Dns4CfgData.DnsServerList != NULL) {
FreePool (Instance->Dns4CfgData.DnsServerList);
+ Instance->Dns4CfgData.DnsServerList = NULL;
}
goto ON_EXIT;
}
@@ -1108,6 +1110,7 @@ Dns6Configure (
if (EFI_ERROR (Status)) {
if (Instance->Dns6CfgData.DnsServerList != NULL) {
FreePool (Instance->Dns6CfgData.DnsServerList);
+ Instance->Dns6CfgData.DnsServerList = NULL;
}
goto ON_EXIT;
}
@@ -1119,6 +1122,7 @@ Dns6Configure (
if (EFI_ERROR (Status)) {
if (Instance->Dns6CfgData.DnsServerList != NULL) {
FreePool (Instance->Dns6CfgData.DnsServerList);
+ Instance->Dns6CfgData.DnsServerList = NULL;
}
goto ON_EXIT;
}