From a7f7d1bde43fc825c49afea3f946f5b4b3d563e0 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 27 Mar 2015 12:02:49 +0100 Subject: fix gcc warnings about uninitialized variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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; ^ --- src/journal-remote/journal-remote.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/journal-remote/journal-remote.c') diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c index 6198a99b75..f87a939168 100644 --- a/src/journal-remote/journal-remote.c +++ b/src/journal-remote/journal-remote.c @@ -349,7 +349,7 @@ static int remove_source(RemoteServer *s, int fd) { static int add_source(RemoteServer *s, int fd, char* name, bool own_name) { - RemoteSource *source; + RemoteSource *source = NULL; int r; /* This takes ownership of name, even on failure, if own_name is true. */ @@ -1144,7 +1144,7 @@ static int dispatch_raw_connection_event(sd_event_source *event, .size = sizeof(union sockaddr_union), .type = SOCK_STREAM, }; - char *hostname; + char *hostname = NULL; fd2 = accept_connection("raw", fd, &addr, &hostname); if (fd2 < 0) -- cgit v1.2.3-54-g00ecf