Free hd_context if error.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2024-08-25 20:00:16 +02:00
parent 28c63a500c
commit 39a5af8649
2 changed files with 4 additions and 1 deletions

View File

@@ -664,6 +664,7 @@ int cmd_cipher_sym() {
secret[64] = { 0 };
mbedtls_aes_init(&ctx);
if (hd_keytype != 0x3) {
mbedtls_ecdsa_free(&hd_context);
return SW_INCORRECT_PARAMS();
}
key_size = 32;