mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-03-08 10:09:54 +00:00
Fix freeing uninitialized fields from the ssl context
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
This commit is contained in:
parent
9627202d3a
commit
d886d9f93c
|
@ -12060,9 +12060,15 @@ void mbedtls_ssl_handshake_free( mbedtls_ssl_context *ssl )
|
||||||
#if defined(MBEDTLS_SSL_FREE_SERVER_CERTIFICATE) && \
|
#if defined(MBEDTLS_SSL_FREE_SERVER_CERTIFICATE) && \
|
||||||
defined(MBEDTLS_X509_CRT_PARSE_C) && \
|
defined(MBEDTLS_X509_CRT_PARSE_C) && \
|
||||||
defined(MBEDTLS_SSL_KEEP_PEER_CERTIFICATE)
|
defined(MBEDTLS_SSL_KEEP_PEER_CERTIFICATE)
|
||||||
mbedtls_x509_crt_free( ssl->session_negotiate->peer_cert );
|
if( ssl->session_negotiate )
|
||||||
mbedtls_free( ssl->session->peer_cert );
|
{
|
||||||
ssl->session->peer_cert = NULL;
|
mbedtls_x509_crt_free( ssl->session_negotiate->peer_cert );
|
||||||
|
}
|
||||||
|
if( ssl->session )
|
||||||
|
{
|
||||||
|
mbedtls_free( ssl->session->peer_cert );
|
||||||
|
ssl->session->peer_cert = NULL;
|
||||||
|
}
|
||||||
#endif /* MBEDTLS_SSL_FREE_SERVER_CERTIFICATE */
|
#endif /* MBEDTLS_SSL_FREE_SERVER_CERTIFICATE */
|
||||||
|
|
||||||
#if defined(MBEDTLS_DHM_C)
|
#if defined(MBEDTLS_DHM_C)
|
||||||
|
|
Loading…
Reference in a new issue