1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-10 11:35:07 -05:00

Dan Becker fixed a minor memory leak on persistent connnections using

FOLLOWLOCATION and CURLOPT_USERPWD.
This commit is contained in:
Daniel Stenberg 2002-11-26 17:32:15 +00:00
parent 0210b3c893
commit e5e2fb8274

View File

@ -440,6 +440,10 @@ CURLcode Curl_http_connect(struct connectdata *conn)
if(conn->bits.user_passwd && !data->state.this_is_a_follow) { if(conn->bits.user_passwd && !data->state.this_is_a_follow) {
/* Authorization: is requested, this is not a followed location, get the /* Authorization: is requested, this is not a followed location, get the
original host name */ original host name */
if (data->state.auth_host)
/* Free to avoid leaking memory on multiple requests*/
free(data->state.auth_host);
data->state.auth_host = strdup(conn->hostname); data->state.auth_host = strdup(conn->hostname);
} }