mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-05-11 06:28:17 +02:00
Fix free before pointers initialised
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
@@ -386,7 +386,6 @@ exit:
|
||||
void md_psa_dynamic_dispatch(int md_type, int pre_psa_ret, int post_psa_engine)
|
||||
{
|
||||
const mbedtls_md_info_t *md_info = mbedtls_md_info_from_type(md_type);
|
||||
TEST_ASSERT(md_info != NULL);
|
||||
mbedtls_md_context_t ctx1, ctx2;
|
||||
|
||||
/* Intentionally no PSA init here! (Will be done later.) */
|
||||
@@ -394,6 +393,8 @@ void md_psa_dynamic_dispatch(int md_type, int pre_psa_ret, int post_psa_engine)
|
||||
mbedtls_md_init(&ctx1);
|
||||
mbedtls_md_init(&ctx2);
|
||||
|
||||
TEST_ASSERT(md_info != NULL);
|
||||
|
||||
/* Before PSA crypto init */
|
||||
TEST_EQUAL(pre_psa_ret, mbedtls_md_setup(&ctx1, md_info, 0));
|
||||
TEST_EQUAL(pre_psa_ret, mbedtls_md_setup(&ctx2, md_info, 0));
|
||||
|
||||
Reference in New Issue
Block a user