Separate psk and psk_identity buffers free

Sometimes, psk_identity buffer can't released because psk buffer is NULL.
So, separate it.
This commit is contained in:
junyeonLEE 2017-12-20 16:29:30 +09:00 committed by Azim Khan
parent f3ada4adb0
commit 316b162ac3

View File

@ -7741,10 +7741,14 @@ void mbedtls_ssl_config_free( mbedtls_ssl_config *conf )
if( conf->psk != NULL )
{
mbedtls_zeroize( conf->psk, conf->psk_len );
mbedtls_zeroize( conf->psk_identity, conf->psk_identity_len );
mbedtls_free( conf->psk );
mbedtls_free( conf->psk_identity );
conf->psk_len = 0;
}
if( conf->psk_identity != NULL )
{
mbedtls_zeroize( conf->psk_identity, conf->psk_identity_len );
mbedtls_free( conf->psk_identity );
conf->psk_identity_len = 0;
}
#endif