diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-01-29 16:21:08 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-01-29 17:14:15 +0100 |
commit | 0e0fd08fc832b8f42e567d722d388eba086da5ff (patch) | |
tree | ee5c9d9bd6d0faba89fc514b4bb72bcb4c18ccb9 /src/resolve/resolved-dns-scope.c | |
parent | resolved: minor cleanups (diff) | |
download | systemd-0e0fd08fc832b8f42e567d722d388eba086da5ff.tar.xz systemd-0e0fd08fc832b8f42e567d722d388eba086da5ff.zip |
resolved: use reference counting for DnsQueryCandidate objects
Follow-up for 4ea8b443de. The logic that manages DnsQueryCandidate is rather
complicated: a calls to dns_query_complete() that wants to destroy a
DnsQueryCandidate can be nested inside a deep chain of calls. Using reference
counts seems like the simplest approach.
DnsSearchDomain already uses reference counting.
This patch effectively brings dns_query_candidate_go() to the state before
4ea8b443de, but wraps the iteration over DnsQueryCandidate.transactions in
dns_query_candidate_ref+dns_query_candidate_unref.
Diffstat (limited to '')
-rw-r--r-- | src/resolve/resolved-dns-scope.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/resolve/resolved-dns-scope.c b/src/resolve/resolved-dns-scope.c index 298ce21ae3..d77e81ae39 100644 --- a/src/resolve/resolved-dns-scope.c +++ b/src/resolve/resolved-dns-scope.c @@ -105,7 +105,7 @@ DnsScope* dns_scope_free(DnsScope *s) { dns_scope_abort_transactions(s); while (s->query_candidates) - dns_query_candidate_free(s->query_candidates); + dns_query_candidate_unref(s->query_candidates); hashmap_free(s->transactions_by_key); |