coverity 156863 fuzxy handle cant get socket

Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
Andy Green 2016-01-19 21:40:41 +08:00
parent e34d4b4b35
commit 4ccc13d3ee

View file

@ -444,6 +444,10 @@ handle_accept(int n)
s->address, s->port);
/* we need to open the associated onward connection */
sockfd = socket(AF_INET, SOCK_STREAM, 0);
if (sockfd < 0) {
lwsl_err("Could not get socket\n");
return -1;
}
if (connect(sockfd, (struct sockaddr *)&serv_addr4,
sizeof(struct sockaddr)) == -1 ||