From 0e26016e3d00631d21ac3b0270aded1b51714845 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Mon, 26 Sep 2022 15:33:35 +0100 Subject: resolved notifications: follow-up fixes Further review comments from: https://github.com/systemd/systemd/pull/22845 --- src/resolve/resolved-dns-query.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/resolve/resolved-dns-query.c') diff --git a/src/resolve/resolved-dns-query.c b/src/resolve/resolved-dns-query.c index 8daaacfc19..50c0e05ca6 100644 --- a/src/resolve/resolved-dns-query.c +++ b/src/resolve/resolved-dns-query.c @@ -427,7 +427,6 @@ DnsQuery *dns_query_free(DnsQuery *q) { } free(q->request_address_string); - free(q->request_name); if (q->manager) { LIST_REMOVE(queries, q->manager->dns_queries, q); @@ -586,12 +585,8 @@ void dns_query_complete(DnsQuery *q, DnsTransactionState state) { q->state = state; - if (state == DNS_TRANSACTION_SUCCESS && set_size(q->manager->varlink_subscription) > 0) { - DnsQuestion *question = q->request_packet ? q->request_packet->question : NULL; - const char *query_name = question ? dns_question_first_name(question) : q->request_name; - if (query_name) - (void) send_dns_notification(q->manager, q->answer, query_name); - } + if (q->question_utf8 && state == DNS_TRANSACTION_SUCCESS && set_size(q->manager->varlink_subscription) > 0) + (void) send_dns_notification(q->manager, q->answer, dns_question_first_name(q->question_utf8)); dns_query_stop(q); if (q->complete) -- cgit v1.2.1