diff options
author | Daniel Stenberg <daniel@haxx.se> | 2003-03-31 21:43:05 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2003-03-31 21:43:05 +0000 |
commit | df00ec3c8200bfc34ab21490f962e84bcc40a736 (patch) | |
tree | 42ea2a2f1f95d254ab67f69fd846c581975fd001 | |
parent | ad6fca28f903423f3593e36a6737b90527abd9ce (diff) |
move the ssl config clone call to before the connectionexists call and then
also subsequently free the ssl struct if the connection struct is to be
deleted
-rw-r--r-- | lib/url.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -2629,6 +2629,11 @@ static CURLcode CreateConnection(struct SessionHandle *data, * new one. *************************************************************/ + /* get a cloned copy of the SSL config situation stored in the + connection struct */ + if(!Curl_clone_ssl_config(&data->set.ssl, &conn->ssl_config)) + return CURLE_OUT_OF_MEMORY; + /* reuse_fresh is set TRUE if we are told to use a fresh connection by force */ if(!data->set.reuse_fresh && @@ -2645,6 +2650,10 @@ static CURLcode CreateConnection(struct SessionHandle *data, if(old_conn->proxyhost) free(old_conn->proxyhost); + /* free the SSL config struct from this connection struct as this was + allocated in vain and is targeted for destruction */ + Curl_free_ssl_config(&conn->ssl_config); + conn = conn_temp; /* use this connection from now on */ /* get the user+password information from the old_conn struct since it may @@ -2709,9 +2718,6 @@ static CURLcode CreateConnection(struct SessionHandle *data, ConnectionStore(data, conn); } - if(!Curl_clone_ssl_config(&data->set.ssl, &conn->ssl_config)) - return CURLE_OUT_OF_MEMORY; - /* Continue connectdata initialization here. * * Inherit the proper values from the urldata struct AFTER we have arranged |