Skip to content

Commit c6251e3

Browse files
sjaakolaJan Lindström
authored andcommitted
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.
1 parent 6d783b6 commit c6251e3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

sql/wsrep_var.cc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,15 @@ bool wsrep_provider_update (sys_var *self, THD* thd, enum_var_type type)
300300
if (wsrep_inited == 1)
301301
wsrep_deinit(false);
302302

303-
char* tmp= strdup(wsrep_provider); // wsrep_init() rewrites provider
303+
char* tmp= strdup(wsrep_provider); // wsrep_init() rewrites provider
304304
//when fails
305+
306+
/* provider status variables are allocated in provider library
307+
and need to freed here, otherwise a dangling reference to
308+
wsrep_status_vars would remain in THD
309+
*/
310+
wsrep_free_status(thd);
311+
305312
if (wsrep_init())
306313
{
307314
my_error(ER_CANT_OPEN_LIBRARY, MYF(0), tmp);

0 commit comments

Comments
 (0)