Don't assume there's a sessionhandle around when a connection is disconnected,

so do the data->reqdata.current_conn assignment when we know there is an easy
handle existing! Fixes the valgrind report on test 509.
This commit is contained in:
Daniel Stenberg 2007-10-25 09:41:35 +00:00
parent 9dbc2c827d
commit ca67dcbc05
1 changed files with 1 additions and 3 deletions

View File

@ -2058,9 +2058,6 @@ static void conn_free(struct connectdata *conn)
if(CURL_SOCKET_BAD != conn->sock[FIRSTSOCKET])
sclose(conn->sock[FIRSTSOCKET]);
if (conn->data->reqdata.current_conn == conn) {
conn->data->reqdata.current_conn = NULL;
}
Curl_safefree(conn->user);
Curl_safefree(conn->passwd);
Curl_safefree(conn->proxyuser);
@ -2170,6 +2167,7 @@ CURLcode Curl_disconnect(struct connectdata *conn)
}
conn_free(conn);
data->reqdata.current_conn = NULL;
return CURLE_OK;
}