Skip to content

Commit

Permalink
MW-175 Fix definitively lost memory in wsrep_get_params
Browse files Browse the repository at this point in the history
  • Loading branch information
sciascid authored and mariadb-SachinSetiya committed Apr 18, 2017
1 parent 1d4cc42 commit 33aaee8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions sql/wsrep_var.cc
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,8 @@ static bool refresh_provider_options()
char* opts= wsrep->options_get(wsrep);
if (opts)
{
if (wsrep_provider_options) my_free((void *)wsrep_provider_options);
wsrep_provider_options = (char*)my_memdup(opts, strlen(opts) + 1,
MYF(MY_WME));
wsrep_provider_options_init(opts);
free(opts);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion wsrep/wsrep_dummy.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ static wsrep_status_t dummy_options_set(
static char* dummy_options_get (wsrep_t* w)
{
WSREP_DBUG_ENTER(w);
return WSREP_DUMMY(w)->options;
return strdup(WSREP_DUMMY(w)->options);
}

static wsrep_status_t dummy_connect(
Expand Down

0 comments on commit 33aaee8

Please sign in to comment.