Merge pull request #4131 from paul-elliott-arm/fix_crypto_leak

Fix memory leak in error case in psa_crypto
This commit is contained in:
Gilles Peskine 2021-02-15 11:38:13 +01:00 committed by GitHub
commit 59ad77032f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -0,0 +1,2 @@
Bugfix
* Fix a memory leak in an error case in psa_generate_derived_key_internal().

View File

@ -5100,7 +5100,7 @@ static psa_status_t psa_generate_derived_key_internal(
status = psa_allocate_buffer_to_slot( slot, bytes );
if( status != PSA_SUCCESS )
return( status );
goto exit;
slot->attr.bits = (psa_key_bits_t) bits;
psa_key_attributes_t attributes = {