diff --git a/src/local.c b/src/local.c index b1ab040bb..47d634ce5 100644 --- a/src/local.c +++ b/src/local.c @@ -168,7 +168,7 @@ create_and_bind(const char *addr, const char *port) { struct addrinfo hints; struct addrinfo *result, *rp; - int s, listen_sock; + int s, listen_sock = -1; memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = AF_UNSPEC; /* Return IPv4 and IPv6 choices */ diff --git a/src/redir.c b/src/redir.c index 4a5a489f0..e60bd4870 100644 --- a/src/redir.c +++ b/src/redir.c @@ -147,7 +147,7 @@ create_and_bind(const char *addr, const char *port) { struct addrinfo hints; struct addrinfo *result, *rp; - int s, listen_sock; + int s, listen_sock = -1; memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = AF_UNSPEC; /* Return IPv4 and IPv6 choices */ diff --git a/src/server.c b/src/server.c index e9cdc2619..073e38b22 100644 --- a/src/server.c +++ b/src/server.c @@ -550,7 +550,7 @@ create_and_bind(const char *host, const char *port, int mptcp) { struct addrinfo hints; struct addrinfo *result, *rp, *ipv4v6bindall; - int s, listen_sock; + int s, listen_sock = -1; memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = AF_UNSPEC; /* Return IPv4 and IPv6 choices */ diff --git a/src/tunnel.c b/src/tunnel.c index e0886bdb9..6641fe62a 100644 --- a/src/tunnel.c +++ b/src/tunnel.c @@ -129,7 +129,7 @@ create_and_bind(const char *addr, const char *port) { struct addrinfo hints; struct addrinfo *result, *rp; - int s, listen_sock; + int s, listen_sock = -1; memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = AF_UNSPEC; /* Return IPv4 and IPv6 choices */ diff --git a/src/udprelay.c b/src/udprelay.c index 23a042497..580ad4bd8 100644 --- a/src/udprelay.c +++ b/src/udprelay.c @@ -446,7 +446,7 @@ create_server_socket(const char *host, const char *port) { struct addrinfo hints; struct addrinfo *result, *rp, *ipv4v6bindall; - int s, server_sock; + int s, server_sock = -1; memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = AF_UNSPEC; /* Return IPv4 and IPv6 choices */