diff options
author | Jiaxin Wu <jiaxin.wu@intel.com> | 2016-06-02 16:23:16 +0800 |
---|---|---|
committer | Jiaxin Wu <jiaxin.wu@intel.com> | 2016-06-13 12:04:27 +0800 |
commit | 520a0746dc0e7212e22894dfffa7cec5c035f137 (patch) | |
tree | c0d901d23c32acad797a398bff0db0793f1ba215 | |
parent | 08c6239d03876ca4df618a499d674d8b04545976 (diff) | |
download | edk2-520a0746dc0e7212e22894dfffa7cec5c035f137.zip edk2-520a0746dc0e7212e22894dfffa7cec5c035f137.tar.gz edk2-520a0746dc0e7212e22894dfffa7cec5c035f137.tar.bz2 |
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>
-rw-r--r-- | NetworkPkg/DnsDxe/DnsProtocol.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/NetworkPkg/DnsDxe/DnsProtocol.c b/NetworkPkg/DnsDxe/DnsProtocol.c index 11009fd..e9101d6 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);
}
|