nss: avoid memory leak on SSL connection failure
This commit is contained in:
parent
66582c04b1
commit
a40f58d2ef
@ -13,6 +13,7 @@ This release includes the following changes:
|
|||||||
|
|
||||||
This release includes the following bugfixes:
|
This release includes the following bugfixes:
|
||||||
|
|
||||||
|
o nss: avoid memory leak on SSL connection failure
|
||||||
o
|
o
|
||||||
|
|
||||||
This release includes the following known bugs:
|
This release includes the following known bugs:
|
||||||
|
@ -1058,6 +1058,7 @@ void Curl_nss_close(struct connectdata *conn, int sockindex)
|
|||||||
#ifdef HAVE_PK11_CREATEGENERICOBJECT
|
#ifdef HAVE_PK11_CREATEGENERICOBJECT
|
||||||
/* destroy all NSS objects in order to avoid failure of NSS shutdown */
|
/* destroy all NSS objects in order to avoid failure of NSS shutdown */
|
||||||
Curl_llist_destroy(connssl->obj_list, NULL);
|
Curl_llist_destroy(connssl->obj_list, NULL);
|
||||||
|
connssl->obj_list = NULL;
|
||||||
#endif
|
#endif
|
||||||
connssl->handle = NULL;
|
connssl->handle = NULL;
|
||||||
}
|
}
|
||||||
@ -1216,7 +1217,7 @@ CURLcode Curl_nss_connect(struct connectdata *conn, int sockindex)
|
|||||||
/* make the socket nonblocking */
|
/* make the socket nonblocking */
|
||||||
sock_opt.option = PR_SockOpt_Nonblocking;
|
sock_opt.option = PR_SockOpt_Nonblocking;
|
||||||
sock_opt.value.non_blocking = PR_TRUE;
|
sock_opt.value.non_blocking = PR_TRUE;
|
||||||
if(PR_SetSocketOption(model, &sock_opt) != SECSuccess)
|
if(PR_SetSocketOption(model, &sock_opt) != PR_SUCCESS)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if(SSL_OptionSet(model, SSL_SECURITY, PR_TRUE) != SECSuccess)
|
if(SSL_OptionSet(model, SSL_SECURITY, PR_TRUE) != SECSuccess)
|
||||||
@ -1407,6 +1408,12 @@ CURLcode Curl_nss_connect(struct connectdata *conn, int sockindex)
|
|||||||
if(model)
|
if(model)
|
||||||
PR_Close(model);
|
PR_Close(model);
|
||||||
|
|
||||||
|
#ifdef HAVE_PK11_CREATEGENERICOBJECT
|
||||||
|
/* cleanup on connection failure */
|
||||||
|
Curl_llist_destroy(connssl->obj_list, NULL);
|
||||||
|
connssl->obj_list = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (ssl3 && tlsv1 && isTLSIntoleranceError(err)) {
|
if (ssl3 && tlsv1 && isTLSIntoleranceError(err)) {
|
||||||
/* schedule reconnect through Curl_retry_request() */
|
/* schedule reconnect through Curl_retry_request() */
|
||||||
data->state.ssl_connect_retry = TRUE;
|
data->state.ssl_connect_retry = TRUE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user