diff --git a/lib/http.c b/lib/http.c index babe3f11125adb4ea557ac802a5d81d5c6195402..89509491fcdaaf4ef3be394ca013c71672eb4b24 100644 --- a/lib/http.c +++ b/lib/http.c @@ -1420,6 +1420,8 @@ CURLcode Curl_http_connect(struct connectdata *conn, bool *done) free(data->state.first_host); data->state.first_host = strdup(conn->host.name); + if(!data->state.first_host) + return CURLE_OUT_OF_MEMORY; } if(conn->protocol & PROT_HTTPS) {