Fix memory leak if user does not calls abort. call abort when connection is closed

pull/8804/head
Netanel Gonen 2018-11-25 15:55:31 +02:00 committed by mohammad1603
parent 58f92c3266
commit 7f49fd2b09
1 changed files with 4 additions and 0 deletions

View File

@ -229,6 +229,7 @@ static void psa_mac_operation( void )
}
case PSA_IPC_DISCONNECT:
{
psa_mac_abort( msg.rhandle );
if( msg.rhandle != NULL )
mbedtls_free( msg.rhandle );
break;
@ -383,6 +384,7 @@ static void psa_hash_operation( void )
}
case PSA_IPC_DISCONNECT:
{
psa_hash_abort( msg.rhandle );
if( msg.rhandle != NULL )
mbedtls_free( msg.rhandle );
break;
@ -868,6 +870,7 @@ static void psa_symmetric_operation( void )
}
case PSA_IPC_DISCONNECT:
{
psa_cipher_abort( msg.rhandle );
if( msg.rhandle != NULL )
mbedtls_free( msg.rhandle );
break;
@ -1365,6 +1368,7 @@ void psa_crypto_generator_operations( void )
}
case PSA_IPC_DISCONNECT:
{
psa_generator_abort( msg.rhandle );
if( msg.rhandle != NULL )
mbedtls_free( msg.rhandle );
break;