From 7f49fd2b0923a8aa84b0b52e5b332a711638e377 Mon Sep 17 00:00:00 2001 From: Netanel Gonen Date: Sun, 25 Nov 2018 15:55:31 +0200 Subject: [PATCH] Fix memory leak if user does not calls abort. call abort when connection is closed --- .../services/crypto/COMPONENT_SPE/psa_crypto_partition.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/TARGET_PSA/services/crypto/COMPONENT_SPE/psa_crypto_partition.c b/components/TARGET_PSA/services/crypto/COMPONENT_SPE/psa_crypto_partition.c index 7632d00c56..f57323af3c 100755 --- a/components/TARGET_PSA/services/crypto/COMPONENT_SPE/psa_crypto_partition.c +++ b/components/TARGET_PSA/services/crypto/COMPONENT_SPE/psa_crypto_partition.c @@ -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;