summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-09-22 11:18:00 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2022-09-22 11:18:00 +0300
commitce23802c0e4c85018f2141d2ebb0602dc0d3d6d8 (patch)
tree9287e0ecd1de4f8665bfa1d1a2427c1aaea2036b /storage
parent2d5cfdc570350d663aea52c8f4ca58d481ce8f8e (diff)
downloadmariadb-git-ce23802c0e4c85018f2141d2ebb0602dc0d3d6d8.tar.gz
MDEV-29600 Memory leak in row_log_table_apply_update()
row_log_table_apply_update(): Free the pcur.old_rec_buf before returning. It may be allocated by btr_pcur_store_position() inside btr_blob_log_check_t::check() and btr_store_big_rec_extern_fields(). This memory leak was introduced in commit 2e814d4702d71a04388386a9f591d14a35980bfe (MariaDB Server 10.2.2) via mysql/mysql-server@ce0a1e85e24e48b8171f767b44330da635a6ea0a (MySQL 5.7.5).
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/row/row0log.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/storage/innobase/row/row0log.cc b/storage/innobase/row/row0log.cc
index 6095d72bb86..8bf70f61d07 100644
--- a/storage/innobase/row/row0log.cc
+++ b/storage/innobase/row/row0log.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2011, 2018, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2021, MariaDB Corporation.
+Copyright (c) 2017, 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -2169,6 +2169,7 @@ func_exit:
}
func_exit_committed:
ut_ad(mtr.has_committed());
+ ut_free(pcur.old_rec_buf);
if (error != DB_SUCCESS) {
/* Report the erroneous row using the new
@@ -2356,7 +2357,8 @@ func_exit_committed:
entry = row_build_index_entry(old_row, old_ext, index, heap);
if (!entry) {
ut_ad(0);
- return(DB_CORRUPTION);
+ error = DB_CORRUPTION;
+ goto func_exit_committed;
}
mtr_start(&mtr);