# | Line 223 | Line 223 | FILE *create_tcp_connection(char *hostname, int port){ | |
---|---|---|
223 | ||
224 | if((get_host_addr(hostname, &haddr))!=0){ | |
225 | log_msg(LOG_CRIT, "Failed to lookup name for %s", hostname); | |
226 | + | close(sock); |
227 | return NULL; | |
228 | } | |
229 | ||
# | Line 234 | Line 235 | FILE *create_tcp_connection(char *hostname, int port){ | |
235 | log_msg(LOG_DEBUG, "Creating a tcp connection"); | |
236 | if(connect(sock, (struct sockaddr *)&addr, sizeof(addr)) !=0){ | |
237 | log_msg(LOG_CRIT, "Failed to connect to hostname %s on port %d", hostname, port); | |
238 | + | close(sock); |
239 | return NULL; | |
240 | } | |
241 |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |