mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #9883 from itayzafrir/crypto-service-proxy-mem-fix
Free dynamic memory in Crypto Service proxy (PSA targets)pull/9899/head
commit
b84439552a
|
@ -412,12 +412,13 @@ psa_status_t psa_aead_encrypt(psa_key_handle_t key_handle,
|
|||
|
||||
handle = psa_connect(PSA_AEAD_ID, MINOR_VER);
|
||||
if (handle <= 0) {
|
||||
return (PSA_ERROR_COMMUNICATION_FAILURE);
|
||||
}
|
||||
|
||||
status = PSA_ERROR_COMMUNICATION_FAILURE;
|
||||
} else {
|
||||
status = psa_call(handle, in_vec, 2, out_vec, 2);
|
||||
psa_close(handle);
|
||||
}
|
||||
|
||||
free(buffer);
|
||||
return (status);
|
||||
}
|
||||
|
||||
|
@ -480,12 +481,13 @@ psa_status_t psa_aead_decrypt(psa_key_handle_t key_handle,
|
|||
|
||||
handle = psa_connect(PSA_AEAD_ID, MINOR_VER);
|
||||
if (handle <= 0) {
|
||||
return (PSA_ERROR_COMMUNICATION_FAILURE);
|
||||
}
|
||||
|
||||
status = PSA_ERROR_COMMUNICATION_FAILURE;
|
||||
} else {
|
||||
status = psa_call(handle, in_vec, 2, out_vec, 2);
|
||||
psa_close(handle);
|
||||
}
|
||||
|
||||
free(buffer);
|
||||
return (status);
|
||||
}
|
||||
|
||||
|
@ -620,12 +622,13 @@ static psa_status_t psa_asymmetric_operation(psa_sec_function_t func,
|
|||
|
||||
handle = psa_connect(PSA_ASYMMETRIC_ID, MINOR_VER);
|
||||
if (handle <= 0) {
|
||||
return (PSA_ERROR_COMMUNICATION_FAILURE);
|
||||
}
|
||||
|
||||
status = PSA_ERROR_COMMUNICATION_FAILURE;
|
||||
} else {
|
||||
status = psa_call(handle, in_vec, 2, out_vec, 2);
|
||||
psa_close(handle);
|
||||
}
|
||||
|
||||
free(buffer);
|
||||
return (status);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue