PARA_NOTICE_LOG("connecting to %s:%d\n", conf->host_arg,
conf->port_arg);
ret = para_connect(phd->fd, &their_addr);
- if (ret < 0)
+ if (ret < 0) {
+ close(phd->fd);
goto err_out;
+ }
mark_fd_nonblock(phd->fd);
phd->status = HTTP_CONNECTED;
return 1;