From 5a31221252b6fe55189348d9433813c5f88f0c78 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Fri, 23 Nov 2012 13:09:54 +0100 Subject: 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. --- server/reds.c | 1 + 1 file changed, 1 insertion(+) diff --git a/server/reds.c b/server/reds.c index 7f729ca5..9626318e 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) { -- cgit v1.2.3