SSL: fix memory leak

In OOM situation. Follow-up fix to commit a9cd4f4ed4.
This commit is contained in:
Quinn Slack 2011-01-10 13:53:01 +01:00 committed by Daniel Stenberg
parent a9cd4f4ed4
commit 1238edaeaf
1 changed files with 4 additions and 1 deletions

View File

@ -350,8 +350,11 @@ CURLcode Curl_ssl_addsessionid(struct connectdata *conn,
store->name = clone_host; /* clone host name */
store->remote_port = conn->remote_port; /* port number */
if(!Curl_clone_ssl_config(&conn->ssl_config, &store->ssl_config))
if(!Curl_clone_ssl_config(&conn->ssl_config, &store->ssl_config)) {
store->sessionid = NULL; /* let caller free sessionid */
free(clone_host);
return CURLE_OUT_OF_MEMORY;
}
return CURLE_OK;
}