resolve: initialize r during OOM

Otherwise we'd use some garbage value in the error path.

../src/resolve/resolved-dns-query.c: In function ‘dns_query_accept’:
../src/resolve/resolved-dns-query.c:944:27: error: ‘r’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  944 |         q->answer_errno = -r;
      |                           ^~
cc1: all warnings being treated as errors

Follow-up for 9ca133e97a.
This commit is contained in:
Frantisek Sumsal
2024-01-04 16:48:10 +01:00
parent 81a183800f
commit 5169f8cfd5

View File

@@ -902,7 +902,7 @@ static void dns_query_accept(DnsQuery *q, DnsQueryCandidate *c) {
if (t->answer_ede_msg) {
answer_ede_msg = strdup(t->answer_ede_msg);
if (!answer_ede_msg) {
log_oom();
r = log_oom();
goto fail;
}
}