summaryrefslogtreecommitdiff
path: root/storage/rocksdb
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2017-12-17 17:53:53 +0200
committerMonty <monty@mariadb.org>2017-12-17 17:53:53 +0200
commit06f0b23a78ab15b6f3d4465e77ac1bdc747524d4 (patch)
treea5df21fc4a88aed6acab6e384044ab2071d1553e /storage/rocksdb
parent4bd63bd55158566db8c8b46b29fee590e9596a5e (diff)
downloadmariadb-git-06f0b23a78ab15b6f3d4465e77ac1bdc747524d4.tar.gz
Fixed memory leak in my_rocks
rocksdb_sys_vars.rocksdb_update_cf_options_basic.test failed with reports about not freed memory.
Diffstat (limited to 'storage/rocksdb')
-rw-r--r--storage/rocksdb/ha_rocksdb.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc
index 98a9785713a..8857b2e8cba 100644
--- a/storage/rocksdb/ha_rocksdb.cc
+++ b/storage/rocksdb/ha_rocksdb.cc
@@ -12337,6 +12337,7 @@ void rocksdb_set_update_cf_options(THD *const /* unused */,
// Basic sanity checking and parsing the options into a map. If this fails
// then there's no point to proceed.
if (!Rdb_cf_options::parse_cf_options(val, &option_map)) {
+ my_free(*reinterpret_cast<char**>(var_ptr));
*reinterpret_cast<char**>(var_ptr) = nullptr;
// NO_LINT_DEBUG
@@ -12405,6 +12406,7 @@ void rocksdb_set_update_cf_options(THD *const /* unused */,
// the CF options. This will results in consistent behavior and avoids
// dealing with cases when only a subset of CF-s was successfully updated.
if (val) {
+ my_free(*reinterpret_cast<char**>(var_ptr));
*reinterpret_cast<char**>(var_ptr) = my_strdup(val, MYF(0));
} else {
*reinterpret_cast<char**>(var_ptr) = nullptr;