Skip to content

Commit fe8c5ce

Browse files
committed
resolve: fix possible memleak
Fortunately, unlike the issue fixed in the previous commit, the memleak should be superficial and not become apparent, as the queries handled here are managed by the stub stream, and will be freed when the stream is closed. Just for safety, and slightly reducing the runtime memory usage by the stub stream.
1 parent 73bfd7b commit fe8c5ce

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/resolve/resolved-dns-stub.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,8 +791,10 @@ static void dns_stub_query_complete(DnsQuery *q) {
791791
* packet doesn't answer our question. In that case let's restart the query,
792792
* now with the redirected question. We'll */
793793
r = dns_query_go(q);
794-
if (r < 0)
794+
if (r < 0) {
795795
log_debug_errno(r, "Failed to restart query: %m");
796+
dns_query_free(q);
797+
}
796798

797799
return;
798800
}

0 commit comments

Comments
 (0)