mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-01-26 21:35:35 +00:00
Fix overiding of return value.
If MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED is defined, then the return value will be overridden by the extra code running after the removed return instruction. Signed-off-by: gabor-mezei-arm <gabor.mezei@arm.com>
This commit is contained in:
parent
785958577e
commit
f1f7b29d76
@ -1734,6 +1734,7 @@ int main( int argc, char *argv[] )
|
|||||||
psa_algorithm_t alg = 0;
|
psa_algorithm_t alg = 0;
|
||||||
psa_key_handle_t psk_slot = 0;
|
psa_key_handle_t psk_slot = 0;
|
||||||
#endif /* MBEDTLS_USE_PSA_CRYPTO */
|
#endif /* MBEDTLS_USE_PSA_CRYPTO */
|
||||||
|
int psk_free_ret = 0;
|
||||||
unsigned char psk[MBEDTLS_PSK_MAX_LEN];
|
unsigned char psk[MBEDTLS_PSK_MAX_LEN];
|
||||||
size_t psk_len = 0;
|
size_t psk_len = 0;
|
||||||
psk_entry *psk_info = NULL;
|
psk_entry *psk_info = NULL;
|
||||||
@ -4301,8 +4302,8 @@ exit:
|
|||||||
sni_free( sni_info );
|
sni_free( sni_info );
|
||||||
#endif
|
#endif
|
||||||
#if defined(MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED)
|
#if defined(MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED)
|
||||||
if( ( ret = psk_free( psk_info ) ) != 0 )
|
if( ( psk_free_ret = psk_free( psk_info ) ) != 0 )
|
||||||
mbedtls_printf( "Failed to list of opaque PSKs - error was %d\n", ret );
|
mbedtls_printf( "Failed to list of opaque PSKs - error was %d\n", psk_free_ret );
|
||||||
#endif
|
#endif
|
||||||
#if defined(MBEDTLS_DHM_C) && defined(MBEDTLS_FS_IO)
|
#if defined(MBEDTLS_DHM_C) && defined(MBEDTLS_FS_IO)
|
||||||
mbedtls_dhm_free( &dhm );
|
mbedtls_dhm_free( &dhm );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user