mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Fix resource leak when using mutex and ssl_cookie
When using ssl_cookie with MBEDTLS_THREADING_C, fix a resource leak caused by initiating a mutex in mbedtls_ssl_cookie_free instead of freeing it. Raised and fix suggested by lan Gillingham in the mbed TLS forum Tracked in #771
This commit is contained in:
@ -98,7 +98,7 @@ void mbedtls_ssl_cookie_free( mbedtls_ssl_cookie_ctx *ctx )
|
||||
mbedtls_md_free( &ctx->hmac_ctx );
|
||||
|
||||
#if defined(MBEDTLS_THREADING_C)
|
||||
mbedtls_mutex_init( &ctx->mutex );
|
||||
mbedtls_mutex_free( &ctx->mutex );
|
||||
#endif
|
||||
|
||||
mbedtls_zeroize( ctx, sizeof( mbedtls_ssl_cookie_ctx ) );
|
||||
|
Reference in New Issue
Block a user