Fix possible memory leak when MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH is defined

Signed-off-by: Teppo Järvelin <teppo.jarvelin@arm.com>
This commit is contained in:
Teppo Järvelin 2020-11-25 10:42:27 +02:00
parent 560203ae01
commit b89cf99a57

View file

@ -12709,6 +12709,7 @@ void mbedtls_ssl_free( mbedtls_ssl_context *ssl )
#endif
mbedtls_platform_zeroize( ssl->out_buf, out_buf_len );
mbedtls_free( ssl->out_buf );
ssl->out_buf = NULL;
}
if( ssl->in_buf != NULL )
@ -12720,6 +12721,7 @@ void mbedtls_ssl_free( mbedtls_ssl_context *ssl )
#endif
mbedtls_platform_zeroize( ssl->in_buf, in_buf_len );
mbedtls_free( ssl->in_buf );
ssl->in_buf = NULL;
}
#if defined(MBEDTLS_ZLIB_SUPPORT)