resolve: several follow-ups for 9ca133e97a0c8795b1f293ccea4965b4ad1accc4.
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 6 Jan 2024 21:01:05 +0000 (06:01 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 10 Jan 2024 17:10:11 +0000 (02:10 +0900)
commit41398e87930902d62a3f6d11e4ff8b4af54fc69e
tree3701086ae291e56acb5f64d3287691a9e0810bbf
parent9ae51762d7be5efc0553cf4039fa7483a2799e45
resolve: several follow-ups for 9ca133e97a0c8795b1f293ccea4965b4ad1accc4.

- add missing initialization for DnsQuery.answer_ede_rcode,

- clear EDE code and message in dns_transaction_reset_answer(),
  otherwise the previous EDE code or message may be mistakenly reused
  on restart. This fixes memory leak of DnsTransaction.answer_ede_msg.

- also clear EDE code and message in dns_query_reset_answer(),
  otherwise ede message is leaked if dns_query_accept() is called
  multiple times for the same DnsQuery.

Follow-up for 9ca133e97a0c8795b1f293ccea4965b4ad1accc4.

Fixes #30752.
src/resolve/resolved-dns-query.c
src/resolve/resolved-dns-query.h
src/resolve/resolved-dns-transaction.c