mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-11-04 04:32:24 -05:00 
			
		
		
		
	Fix memory leak in psa_destroy_key
This commit is contained in:
		
							parent
							
								
									6d9121381a
								
							
						
					
					
						commit
						3c6e970752
					
				@ -385,6 +385,7 @@ psa_status_t psa_destroy_key(psa_key_slot_t key)
 | 
				
			|||||||
        slot->type == PSA_KEY_TYPE_RSA_KEYPAIR )
 | 
					        slot->type == PSA_KEY_TYPE_RSA_KEYPAIR )
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        mbedtls_rsa_free( slot->data.rsa );
 | 
					        mbedtls_rsa_free( slot->data.rsa );
 | 
				
			||||||
 | 
					        mbedtls_free( slot->data.rsa );
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
#endif /* defined(MBEDTLS_RSA_C) */
 | 
					#endif /* defined(MBEDTLS_RSA_C) */
 | 
				
			||||||
@ -392,6 +393,7 @@ psa_status_t psa_destroy_key(psa_key_slot_t key)
 | 
				
			|||||||
    if( PSA_KEY_TYPE_IS_ECC( slot->type ) )
 | 
					    if( PSA_KEY_TYPE_IS_ECC( slot->type ) )
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        mbedtls_ecp_keypair_free( slot->data.ecp );
 | 
					        mbedtls_ecp_keypair_free( slot->data.ecp );
 | 
				
			||||||
 | 
					        mbedtls_free( slot->data.ecp );
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
#endif /* defined(MBEDTLS_ECP_C) */
 | 
					#endif /* defined(MBEDTLS_ECP_C) */
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user