Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
tcp: fix memory leak in error path in tcp_server_create() (coverity)
  • Loading branch information
perexg committed Oct 3, 2014
1 parent 45d3685 commit a7e6993
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/tcp.c
Expand Up @@ -585,8 +585,10 @@ tcp_server_create
}

fd = tvh_socket(use->ai_family, use->ai_socktype, use->ai_protocol);
if(fd == -1)
if(fd == -1) {
freeaddrinfo(ressave);
return NULL;
}

if(use->ai_family == AF_INET6)
setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &zero, sizeof(int));
Expand Down

0 comments on commit a7e6993

Please sign in to comment.