diff --git a/lib/connect.c b/lib/connect.c index ec68162c3141bc4fd5682167a67b3efd9fd46b77..8ff3dd16f82a826c6ce2af5222ebf48c4246b86d 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -176,6 +176,8 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* * Connecting with IPv6 support is so much easier and cleanly done */ + port =0; /* we already have port in the 'remotehost' struct */ + if(sockfd != -1) /* don't use any previous one, it might be of wrong type */ sclose(sockfd);