summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--storage/innobase/fil/fil0crypt.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc
index 7f35e86bbc8..c7d740bc6af 100644
--- a/storage/innobase/fil/fil0crypt.cc
+++ b/storage/innobase/fil/fil0crypt.cc
@@ -502,16 +502,16 @@ fil_parse_write_crypt_data(
ptr += len;
/* update fil_space memory cache with crypt_data */
- fil_space_t* space = fil_space_acquire_silent(space_id);
-
- if (space) {
+ if (fil_space_t* space = fil_space_acquire_silent(space_id)) {
crypt_data = fil_space_set_crypt_data(space, crypt_data);
fil_space_release(space);
- }
-
- /* Check is used key found from encryption plugin */
- if (crypt_data->should_encrypt() && !crypt_data->is_key_found()) {
- *err = DB_DECRYPTION_FAILED;
+ /* Check is used key found from encryption plugin */
+ if (crypt_data->should_encrypt()
+ && !crypt_data->is_key_found()) {
+ *err = DB_DECRYPTION_FAILED;
+ }
+ } else {
+ fil_space_destroy_crypt_data(&crypt_data);
}
return ptr;