resolve: unref stream after completion processes

Fixes #9511.
This commit is contained in:
Yu Watanabe 2018-07-12 12:57:52 +09:00
parent 06bed19ea1
commit 18df5fb017
1 changed files with 2 additions and 1 deletions

View File

@ -518,12 +518,13 @@ static int on_stream_connection(DnsStream *s) {
}
static int on_stream_complete(DnsStream *s, int error) {
_cleanup_(dns_stream_unrefp) DnsStream *p = NULL;
DnsTransaction *t, *n;
int r = 0;
/* Do not let new transactions use this stream */
if (s->server && s->server->stream == s)
s->server->stream = dns_stream_unref(s->server->stream);
p = TAKE_PTR(s->server->stream);
if (ERRNO_IS_DISCONNECT(error) && s->protocol != DNS_PROTOCOL_LLMNR) {
usec_t usec;