mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 10:14:19 +01:00
Follow-up for MDEV-11630 Call mutex_free() before freeing the mutex list
fil_tablespace_iterate(): Call fil_space_destroy_crypt_data() to invoke mutex_free() for the mutex_create() that was done in fil_space_read_crypt_data(). Also, remember to free iter.crypt_io_buffer. The failure to call mutex_free() would cause sync_latch_meta_destroy() to access freed memory on shutdown. This affected the IMPORT of encrypted tablespaces.
This commit is contained in:
parent
08f79bdeda
commit
bbb3fb318e
1 changed files with 8 additions and 8 deletions
|
@ -6685,18 +6685,18 @@ fil_tablespace_iterate(
|
|||
iter.io_buffer = static_cast<byte*>(
|
||||
ut_align(io_buffer, UNIV_PAGE_SIZE));
|
||||
|
||||
/** Add an exta buffer for encryption */
|
||||
void* crypt_io_buffer = NULL;
|
||||
if (iter.crypt_data != NULL) {
|
||||
crypt_io_buffer = ut_malloc_nokey(
|
||||
iter.n_io_buffers * UNIV_PAGE_SIZE);
|
||||
iter.crypt_io_buffer = static_cast<byte*>(
|
||||
crypt_io_buffer);
|
||||
}
|
||||
iter.crypt_io_buffer = iter.crypt_data
|
||||
? static_cast<byte*>(
|
||||
ut_malloc_nokey(iter.n_io_buffers
|
||||
* UNIV_PAGE_SIZE))
|
||||
: NULL;
|
||||
|
||||
err = fil_iterate(iter, block, callback);
|
||||
|
||||
ut_free(io_buffer);
|
||||
ut_free(iter.crypt_io_buffer);
|
||||
|
||||
fil_space_destroy_crypt_data(&iter.crypt_data);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue