bail out on strdup() errors

This commit is contained in:
Daniel Stenberg
2007-01-24 12:34:23 +00:00
parent 354c8dcd82
commit 45bac25d90

View File

@@ -1420,6 +1420,8 @@ CURLcode Curl_http_connect(struct connectdata *conn, bool *done)
free(data->state.first_host); free(data->state.first_host);
data->state.first_host = strdup(conn->host.name); data->state.first_host = strdup(conn->host.name);
if(!data->state.first_host)
return CURLE_OUT_OF_MEMORY;
} }
if(conn->protocol & PROT_HTTPS) { if(conn->protocol & PROT_HTTPS) {