mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
Fix potential NULL pointer dereference
* src/gnutls.c (ssl_connect_wget): check for NULL before calls
This commit is contained in:
parent
b1c7777037
commit
46cd721c0f
10
src/gnutls.c
10
src/gnutls.c
@ -633,9 +633,13 @@ ssl_connect_wget (int fd, const char *hostname, int *continue_session)
|
|||||||
{
|
{
|
||||||
if (!ctx || !ctx->session_data || gnutls_session_set_data (session, ctx->session_data->data, ctx->session_data->size))
|
if (!ctx || !ctx->session_data || gnutls_session_set_data (session, ctx->session_data->data, ctx->session_data->size))
|
||||||
{
|
{
|
||||||
/* server does not want to continue the session */
|
if (ctx && ctx->session_data)
|
||||||
gnutls_free (ctx->session_data->data);
|
{
|
||||||
gnutls_free (ctx->session_data);
|
/* server does not want to continue the session */
|
||||||
|
if (ctx->session_data->data)
|
||||||
|
gnutls_free (ctx->session_data->data);
|
||||||
|
gnutls_free (ctx->session_data);
|
||||||
|
}
|
||||||
gnutls_deinit (session);
|
gnutls_deinit (session);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user