summaryrefslogtreecommitdiff
path: root/src/resolve
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2015-03-27 12:02:49 +0100
committerHarald Hoyer <harald@redhat.com>2015-03-27 14:57:38 +0100
commita7f7d1bde43fc825c49afea3f946f5b4b3d563e0 (patch)
treee6202adf568f95dbf22d7fb0c51f8c9220a56964 /src/resolve
parent47d45d3cde45d6545367570264e4e3636bc9e345 (diff)
fix gcc warnings about uninitialized variables
like: src/shared/install.c: In function ‘unit_file_lookup_state’: src/shared/install.c:1861:16: warning: ‘r’ may be used uninitialized in this function [-Wmaybe-uninitialized] return r < 0 ? r : state; ^ src/shared/install.c:1796:13: note: ‘r’ was declared here int r; ^
Diffstat (limited to 'src/resolve')
-rw-r--r--src/resolve/resolved-dns-transaction.c2
-rw-r--r--src/resolve/test-dns-domain.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/resolve/resolved-dns-transaction.c b/src/resolve/resolved-dns-transaction.c
index 74b063414..bc1a90db1 100644
--- a/src/resolve/resolved-dns-transaction.c
+++ b/src/resolve/resolved-dns-transaction.c
@@ -252,7 +252,7 @@ static int dns_transaction_open_tcp(DnsTransaction *t) {
fd = dns_scope_tcp_socket(t->scope, t->received->family, &t->received->sender, t->received->sender_port);
else {
union in_addr_union address;
- int family;
+ int family = AF_UNSPEC;
/* Otherwise, try to talk to the owner of a
* the IP address, in case this is a reverse
diff --git a/src/resolve/test-dns-domain.c b/src/resolve/test-dns-domain.c
index 2f3edaf78..c3208abc7 100644
--- a/src/resolve/test-dns-domain.c
+++ b/src/resolve/test-dns-domain.c
@@ -161,7 +161,7 @@ static void test_dns_name_single_label(void) {
static void test_dns_name_reverse_one(const char *address, const char *name) {
_cleanup_free_ char *p = NULL;
- union in_addr_union a, b;
+ union in_addr_union a, b = {};
int familya, familyb;
assert_se(in_addr_from_string_auto(address, &familya, &a) >= 0);