diff options
author | sjaakola <seppo.jaakola@iki.fi> | 2017-08-10 14:04:55 +0300 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2017-11-08 14:20:30 +0200 |
commit | c6251e36fc8e8704fd2c6dd88e5ea7dd2d4bcce6 (patch) | |
tree | 0df170b1d989032d735abed0a5ceb373e5aef393 | |
parent | 6d783b6a7625cd7a5b5727634c490bbd15c5c791 (diff) | |
download | mariadb-git-c6251e36fc8e8704fd2c6dd88e5ea7dd2d4bcce6.tar.gz |
MW-399 Freeing wsrep_status_vars, before provider is released.
This is needed to clear THD::wsrep_status_vars reference,
which would otherwise remain to point to status variable array, which is no more effective.
-rw-r--r-- | sql/wsrep_var.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sql/wsrep_var.cc b/sql/wsrep_var.cc index 20091a3893e..8cb80a7c13a 100644 --- a/sql/wsrep_var.cc +++ b/sql/wsrep_var.cc @@ -300,8 +300,15 @@ bool wsrep_provider_update (sys_var *self, THD* thd, enum_var_type type) if (wsrep_inited == 1) wsrep_deinit(false); - char* tmp= strdup(wsrep_provider); // wsrep_init() rewrites provider + char* tmp= strdup(wsrep_provider); // wsrep_init() rewrites provider //when fails + + /* provider status variables are allocated in provider library + and need to freed here, otherwise a dangling reference to + wsrep_status_vars would remain in THD + */ + wsrep_free_status(thd); + if (wsrep_init()) { my_error(ER_CANT_OPEN_LIBRARY, MYF(0), tmp); |