]> git.proxmox.com Git - mirror_edk2.git/commitdiff
NetworkPkg: Fix invalid pointer for DNS response token on error
authorLiming Gao <gaoliming@byosoft.com.cn>
Thu, 25 Nov 2021 16:11:06 +0000 (00:11 +0800)
committerLiming Gao <gaoliming@byosoft.com.cn>
Fri, 26 Nov 2021 08:54:49 +0000 (16:54 +0800)
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>
NetworkPkg/DnsDxe/DnsImpl.c

index 2edcb280ac4d3b41fe8da8cd37e90626e86c0d25..78a56f2b56512bfd3c89d467d66a23a52aa09e7d 100644 (file)
@@ -1700,6 +1700,7 @@ ON_EXIT:
           }\r
 \r
           FreePool (Dns4TokenEntry->Token->RspData.H2AData);\r
+          Dns4TokenEntry->Token->RspData.H2AData = NULL;\r
         }\r
       }\r
     }\r
@@ -1731,6 +1732,7 @@ ON_EXIT:
           }\r
 \r
           FreePool (Dns6TokenEntry->Token->RspData.H2AData);\r
+          Dns6TokenEntry->Token->RspData.H2AData = NULL;\r
         }\r
       }\r
     }\r