Commit 2a5e68ea authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

added some defensive code around the GetHost()'s third argument result

parent c06f7266
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1312,7 +1312,7 @@ static CURLcode _connect(CURL *curl, CURLconnect **in_connect)
  if (data->device && (strlen(data->device)<255)) {
    struct sockaddr_in sa;
    struct hostent *h=NULL;
    char *hostdataptr;
    char *hostdataptr=NULL;
    size_t size;
    char myhost[256] = "";
    unsigned long in;
@@ -1425,6 +1425,7 @@ static CURLcode _connect(CURL *curl, CURLconnect **in_connect)
      return CURLE_HTTP_PORT_FAILED;
    }

    if(hostdataptr)
      free(hostdataptr); /* allocated by GetHost() */

  } /* end of device selection support */