pcp_internal_error(pcpConn,
"ERROR: failed to create INET domain socket with error \"%s\"",
strerror(errno));
+ freeaddrinfo(res);
return pcpConn;
}
(char *) &on, sizeof(on)) < 0)
{
close(fd);
+ freeaddrinfo(res);
pcp_internal_error(pcpConn,
"ERROR: set socket option failed with error \"%s\"", strerror(errno));
pcpConn->connState = PCP_CONNECTION_BAD;
if (connect(fd, walk->ai_addr, walk->ai_addrlen) < 0)
{
close(fd);
+ freeaddrinfo(res);
pcp_internal_error(pcpConn,
"ERROR: connection to host \"%s\" failed with error \"%s\"", hostname, strerror(errno));
pcpConn->connState = PCP_CONNECTION_BAD;
break; /* successfully connected */
}
+ freeaddrinfo(res);
/* no address available */
if (fd == -1)
{