diff --git a/subsys/bluetooth/host/gatt.c b/subsys/bluetooth/host/gatt.c index 12ec91c78e4..a99a497749f 100644 --- a/subsys/bluetooth/host/gatt.c +++ b/subsys/bluetooth/host/gatt.c @@ -755,6 +755,8 @@ static int db_hash_finish(struct gen_hash_state *state) size_t mac_length; psa_status_t ret = psa_mac_sign_finish(&(state->operation), db_hash.hash, 16, &mac_length); + psa_destroy_key(state->key); + if (ret != PSA_SUCCESS) { LOG_ERR("CMAC finish failed %d", ret); return -EIO;