]> git.ipfire.org Git - thirdparty/systemd.git/commit
resolve: initialize `r` during OOM
authorFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 4 Jan 2024 15:48:10 +0000 (16:48 +0100)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 4 Jan 2024 19:56:21 +0000 (20:56 +0100)
commit5169f8cfd543cbce498871527ea8aa454ff2c252
tree8608bb6714706e9a1413973667662530f88d1ae6
parent81a183800fec3a144b345213066c58431cb7e85b
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 9ca133e97a0.
src/resolve/resolved-dns-query.c