mirror of
https://github.com/curl/curl.git
synced 2025-02-17 14:59:45 +08:00
wolfssl: don't store a NULL sessionid
This caused a memory leak as the session id cache entry was still erroneously stored with a NULL sessionid and that would later be treated as not needed to get freed. Reported-by: Gisle Vanem Fixes #6616 Closes #6617
This commit is contained in:
parent
f248a13065
commit
bc928be02c
@ -770,11 +770,10 @@ wolfssl_connect_step3(struct Curl_easy *data, struct connectdata *conn,
|
||||
|
||||
if(SSL_SET_OPTION(primary.sessionid)) {
|
||||
bool incache;
|
||||
SSL_SESSION *our_ssl_sessionid;
|
||||
void *old_ssl_sessionid = NULL;
|
||||
SSL_SESSION *our_ssl_sessionid = SSL_get_session(backend->handle);
|
||||
|
||||
our_ssl_sessionid = SSL_get_session(backend->handle);
|
||||
|
||||
if(our_ssl_sessionid) {
|
||||
Curl_ssl_sessionid_lock(data);
|
||||
incache = !(Curl_ssl_getsessionid(data, conn, &old_ssl_sessionid, NULL,
|
||||
sockindex));
|
||||
@ -797,6 +796,7 @@ wolfssl_connect_step3(struct Curl_easy *data, struct connectdata *conn,
|
||||
}
|
||||
Curl_ssl_sessionid_unlock(data);
|
||||
}
|
||||
}
|
||||
|
||||
connssl->connecting_state = ssl_connect_done;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user