summaryrefslogtreecommitdiff
authorChristophe Fergeau <cfergeau@redhat.com>2012-11-23 12:09:54 (GMT)
committer Christophe Fergeau <cfergeau@redhat.com>2012-12-12 17:15:47 (GMT)
commit5a31221252b6fe55189348d9433813c5f88f0c78 (patch) (side-by-side diff)
tree86890fad3e953ff738f8e65508843e2993e5e3b3
parent0b1d268011dc0b1518b61cb21073f21cdc53628f (diff)
downloadspice-5a31221252b6fe55189348d9433813c5f88f0c78.zip
spice-5a31221252b6fe55189348d9433813c5f88f0c78.tar.gz
Fail reds_init_socket when getaddrinfo fails
We currently output a warning when getaddrinfo fails, but then we go on trying to use the information it couldn't read. Make sure we bail out of reds_init_socket if getaddrinfo fails.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--server/reds.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/server/reds.c b/server/reds.c
index 7f729ca..9626318 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -2973,6 +2973,7 @@ static int reds_init_socket(const char *addr, int portnr, int family)
if (rc != 0) {
spice_warning("getaddrinfo(%s,%s): %s", addr, port,
gai_strerror(rc));
+ return -1;
}
for (e = res; e != NULL; e = e->ai_next) {