Merge pull request #9883 from itayzafrir/crypto-service-proxy-mem-fix

Free dynamic memory in Crypto Service proxy (PSA targets)
pull/9899/head
Cruz Monrreal 2019-02-28 18:23:17 -06:00 committed by GitHub
commit b84439552a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 12 deletions

View File

@ -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);
}