From e7acbec368409315373ce1abda6b446e8bb87dc7 Mon Sep 17 00:00:00 2001 From: marko Date: Mon, 27 Feb 2006 16:03:32 +0000 Subject: [PATCH] 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. --- page/page0zip.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/page/page0zip.c b/page/page0zip.c index ed65d604d42..6db2289d71e 100644 --- a/page/page0zip.c +++ b/page/page0zip.c @@ -1525,9 +1525,6 @@ zlib_done: 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( page_zip, page, info_bits))) { err_exit: @@ -1602,10 +1599,12 @@ err_exit: ut_ad(page_simple_validate_new(page)); if (UNIV_LIKELY_NULL(mtr)) { - mlog_open_and_write_index(mtr, page, index, - MLOG_ZIP_DECOMPRESS, 0); + mlog_write_initial_log_record(page, MLOG_ZIP_DECOMPRESS, mtr); } + page_zip_fields_free(index); + mem_heap_free(heap); + return(TRUE); }