Skip to content

Commit 4487805

Browse files
author
Netanel Gonen
committed
Fix memory leak if user does not calls abort. call abort when connection is closed
1 parent 0a09f14 commit 4487805

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

components/TARGET_PSA/services/crypto/COMPONENT_SPE/psa_crypto_partition.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ static void psa_mac_operation( void )
229229
}
230230
case PSA_IPC_DISCONNECT:
231231
{
232+
psa_mac_abort( msg.rhandle );
232233
if( msg.rhandle != NULL )
233234
mbedtls_free( msg.rhandle );
234235
break;
@@ -383,6 +384,7 @@ static void psa_hash_operation( void )
383384
}
384385
case PSA_IPC_DISCONNECT:
385386
{
387+
psa_hash_abort( msg.rhandle );
386388
if( msg.rhandle != NULL )
387389
mbedtls_free( msg.rhandle );
388390
break;
@@ -868,6 +870,7 @@ static void psa_symmetric_operation( void )
868870
}
869871
case PSA_IPC_DISCONNECT:
870872
{
873+
psa_cipher_abort( msg.rhandle );
871874
if( msg.rhandle != NULL )
872875
mbedtls_free( msg.rhandle );
873876
break;
@@ -1365,6 +1368,7 @@ void psa_crypto_generator_operations( void )
13651368
}
13661369
case PSA_IPC_DISCONNECT:
13671370
{
1371+
psa_generator_abort( msg.rhandle );
13681372
if( msg.rhandle != NULL )
13691373
mbedtls_free( msg.rhandle );
13701374
break;

0 commit comments

Comments
 (0)