Fix memory leak in SSL_new if errors occur.
Reviewed-by: Richard Levitte <levitte@openssl.org>
This commit is contained in:
parent
7bca0a1db5
commit
76e6509085
@ -417,13 +417,7 @@ SSL *SSL_new(SSL_CTX *ctx)
|
||||
return(s);
|
||||
err:
|
||||
if (s != NULL)
|
||||
{
|
||||
if (s->cert != NULL)
|
||||
ssl_cert_free(s->cert);
|
||||
if (s->ctx != NULL)
|
||||
SSL_CTX_free(s->ctx); /* decrement reference count */
|
||||
OPENSSL_free(s);
|
||||
}
|
||||
SSL_free(s);
|
||||
SSLerr(SSL_F_SSL_NEW,ERR_R_MALLOC_FAILURE);
|
||||
return(NULL);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user