NetworkPkg: Fix invalid pointer for DNS response token on error

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3719

This issue is introduced by the commit 43d7e607.
Token->RspData.H2AData is de-allocated on error but it is not
set to NULL. HTTP module attempts to free again and cause assert.

Signed-off-by: Baraneedharan Anbazhagan <anbazhagan@hp.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
This commit is contained in:
Liming Gao 2021-11-26 00:11:06 +08:00
parent 4c7ce0d285
commit bb1bba3d77
1 changed files with 2 additions and 0 deletions

View File

@ -1700,6 +1700,7 @@ ON_EXIT:
}
FreePool (Dns4TokenEntry->Token->RspData.H2AData);
Dns4TokenEntry->Token->RspData.H2AData = NULL;
}
}
}
@ -1731,6 +1732,7 @@ ON_EXIT:
}
FreePool (Dns6TokenEntry->Token->RspData.H2AData);
Dns6TokenEntry->Token->RspData.H2AData = NULL;
}
}
}