mirror of https://github.com/acidanthera/audk.git
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>
This commit is contained in:
parent
08c6239d03
commit
520a0746dc
|
@ -493,6 +493,8 @@ Dns4HostNameToIp (
|
||||||
//
|
//
|
||||||
Status = DoDnsQuery (Instance, Packet);
|
Status = DoDnsQuery (Instance, Packet);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
|
Dns4RemoveTokenEntry (&Instance->Dns4TxTokens, TokenEntry);
|
||||||
|
|
||||||
if (TokenEntry != NULL) {
|
if (TokenEntry != NULL) {
|
||||||
FreePool (TokenEntry);
|
FreePool (TokenEntry);
|
||||||
}
|
}
|
||||||
|
@ -675,6 +677,8 @@ Dns4GeneralLookUp (
|
||||||
//
|
//
|
||||||
Status = DoDnsQuery (Instance, Packet);
|
Status = DoDnsQuery (Instance, Packet);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
|
Dns4RemoveTokenEntry (&Instance->Dns4TxTokens, TokenEntry);
|
||||||
|
|
||||||
if (TokenEntry != NULL) {
|
if (TokenEntry != NULL) {
|
||||||
FreePool (TokenEntry);
|
FreePool (TokenEntry);
|
||||||
}
|
}
|
||||||
|
@ -1303,6 +1307,8 @@ Dns6HostNameToIp (
|
||||||
//
|
//
|
||||||
Status = DoDnsQuery (Instance, Packet);
|
Status = DoDnsQuery (Instance, Packet);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
|
Dns6RemoveTokenEntry (&Instance->Dns6TxTokens, TokenEntry);
|
||||||
|
|
||||||
if (TokenEntry != NULL) {
|
if (TokenEntry != NULL) {
|
||||||
FreePool (TokenEntry);
|
FreePool (TokenEntry);
|
||||||
}
|
}
|
||||||
|
@ -1488,6 +1494,8 @@ Dns6GeneralLookUp (
|
||||||
//
|
//
|
||||||
Status = DoDnsQuery (Instance, Packet);
|
Status = DoDnsQuery (Instance, Packet);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
|
Dns6RemoveTokenEntry (&Instance->Dns6TxTokens, TokenEntry);
|
||||||
|
|
||||||
if (TokenEntry != NULL) {
|
if (TokenEntry != NULL) {
|
||||||
FreePool (TokenEntry);
|
FreePool (TokenEntry);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue