dns_query_reset_answer(q);
- q->answer = answer;
- answer = NULL;
+ q->answer = TAKE_PTR(answer);
q->answer_rcode = DNS_RCODE_SUCCESS;
q->answer_protocol = dns_synthesize_protocol(q->flags);
q->answer_family = dns_synthesize_family(q->flags);
dns_query_reset_answer(q);
- q->answer = answer;
- answer = NULL;
+ q->answer = TAKE_PTR(answer);
q->answer_rcode = DNS_RCODE_SUCCESS;
q->answer_protocol = dns_synthesize_protocol(q->flags);
q->answer_family = dns_synthesize_family(q->flags);
q->flags |= SD_RESOLVED_NO_SEARCH;
dns_question_unref(q->question_idna);
- q->question_idna = nq_idna;
- nq_idna = NULL;
+ q->question_idna = TAKE_PTR(nq_idna);
dns_question_unref(q->question_utf8);
- q->question_utf8 = nq_utf8;
- nq_utf8 = NULL;
+ q->question_utf8 = TAKE_PTR(nq_utf8);
dns_query_free_candidates(q);
dns_query_reset_answer(q);