mirror of
https://github.com/MariaDB/server.git
synced 2025-02-01 11:31:51 +01:00
branches/zip: Fix a memory management bug.
page_zip_decompress(): Free index and heap at the end of the function. Do not write the index to the MLOG_ZIP_DECOMPRESS record, since it can be decoded from the compressed page.
This commit is contained in:
parent
a71a1e9c08
commit
e7acbec368
1 changed files with 4 additions and 5 deletions
|
@ -1525,9 +1525,6 @@ zlib_done:
|
||||||
page_zip->m_end = mod_log_ptr - page_zip->data;
|
page_zip->m_end = mod_log_ptr - page_zip->data;
|
||||||
}
|
}
|
||||||
|
|
||||||
page_zip_fields_free(index);
|
|
||||||
mem_heap_free(heap);
|
|
||||||
|
|
||||||
if (UNIV_UNLIKELY(!page_zip_set_extra_bytes(
|
if (UNIV_UNLIKELY(!page_zip_set_extra_bytes(
|
||||||
page_zip, page, info_bits))) {
|
page_zip, page, info_bits))) {
|
||||||
err_exit:
|
err_exit:
|
||||||
|
@ -1602,10 +1599,12 @@ err_exit:
|
||||||
ut_ad(page_simple_validate_new(page));
|
ut_ad(page_simple_validate_new(page));
|
||||||
|
|
||||||
if (UNIV_LIKELY_NULL(mtr)) {
|
if (UNIV_LIKELY_NULL(mtr)) {
|
||||||
mlog_open_and_write_index(mtr, page, index,
|
mlog_write_initial_log_record(page, MLOG_ZIP_DECOMPRESS, mtr);
|
||||||
MLOG_ZIP_DECOMPRESS, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
page_zip_fields_free(index);
|
||||||
|
mem_heap_free(heap);
|
||||||
|
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue