summaryrefslogtreecommitdiff
path: root/NetworkPkg
diff options
context:
space:
mode:
authorJiaxin Wu <jiaxin.wu@intel.com>2016-06-02 16:23:16 +0800
committerJiaxin Wu <jiaxin.wu@intel.com>2016-06-13 12:04:27 +0800
commit520a0746dc0e7212e22894dfffa7cec5c035f137 (patch)
treec0d901d23c32acad797a398bff0db0793f1ba215 /NetworkPkg
parent08c6239d03876ca4df618a499d674d8b04545976 (diff)
downloadedk2-platforms-520a0746dc0e7212e22894dfffa7cec5c035f137.tar.xz
NetworkPkg: Remove TokenEntry from Token list before freed
TokenEntry should be removed from Token list before freed. Otherwise, invalid TokenEntry will be existed in Token list. Cc: Ye Ting <ting.ye@intel.com> Cc: Zhang Lubo <lubo.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Zhang Lubo <lubo.zhang@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
Diffstat (limited to 'NetworkPkg')
-rw-r--r--NetworkPkg/DnsDxe/DnsProtocol.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/NetworkPkg/DnsDxe/DnsProtocol.c b/NetworkPkg/DnsDxe/DnsProtocol.c
index 11009fdc0d..e9101d6644 100644
--- a/NetworkPkg/DnsDxe/DnsProtocol.c
+++ b/NetworkPkg/DnsDxe/DnsProtocol.c
@@ -493,6 +493,8 @@ Dns4HostNameToIp (
//
Status = DoDnsQuery (Instance, Packet);
if (EFI_ERROR (Status)) {
+ Dns4RemoveTokenEntry (&Instance->Dns4TxTokens, TokenEntry);
+
if (TokenEntry != NULL) {
FreePool (TokenEntry);
}
@@ -675,6 +677,8 @@ Dns4GeneralLookUp (
//
Status = DoDnsQuery (Instance, Packet);
if (EFI_ERROR (Status)) {
+ Dns4RemoveTokenEntry (&Instance->Dns4TxTokens, TokenEntry);
+
if (TokenEntry != NULL) {
FreePool (TokenEntry);
}
@@ -1303,6 +1307,8 @@ Dns6HostNameToIp (
//
Status = DoDnsQuery (Instance, Packet);
if (EFI_ERROR (Status)) {
+ Dns6RemoveTokenEntry (&Instance->Dns6TxTokens, TokenEntry);
+
if (TokenEntry != NULL) {
FreePool (TokenEntry);
}
@@ -1488,6 +1494,8 @@ Dns6GeneralLookUp (
//
Status = DoDnsQuery (Instance, Packet);
if (EFI_ERROR (Status)) {
+ Dns6RemoveTokenEntry (&Instance->Dns6TxTokens, TokenEntry);
+
if (TokenEntry != NULL) {
FreePool (TokenEntry);
}