Commit 52f1543e authored by Nirbhay Choubey's avatar Nirbhay Choubey

Fix for a memory leak.

parent e9963041
......@@ -1199,6 +1199,7 @@ static int wsrep_TOI_begin(THD *thd, char *db_, char *table_,
uchar* buf(0);
size_t buf_len(0);
int buf_err;
int rc= 0;
WSREP_DEBUG("TO BEGIN: %lld, %d : %s", (long long)wsrep_thd_trx_seqno(thd),
thd->wsrep_exec_mode, thd->query() );
......@@ -1238,7 +1239,6 @@ static int wsrep_TOI_begin(THD *thd, char *db_, char *table_,
{
thd->wsrep_exec_mode= TOTAL_ORDER;
wsrep_to_isolation++;
if (buf) my_free(buf);
wsrep_keys_free(&key_arr);
WSREP_DEBUG("TO BEGIN: %lld, %d",(long long)wsrep_thd_trx_seqno(thd),
thd->wsrep_exec_mode);
......@@ -1250,18 +1250,18 @@ static int wsrep_TOI_begin(THD *thd, char *db_, char *table_,
ret, (thd->query()) ? thd->query() : "void");
my_error(ER_LOCK_DEADLOCK, MYF(0), "WSREP replication failed. Check "
"your wsrep connection state and retry the query.");
if (buf) my_free(buf);
wsrep_keys_free(&key_arr);
return -1;
rc= -1;
}
else {
/* non replicated DDL, affecting temporary tables only */
WSREP_DEBUG("TO isolation skipped for: %d, sql: %s."
"Only temporary tables affected.",
ret, (thd->query()) ? thd->query() : "void");
return 1;
rc= 1;
}
return 0;
if (buf) my_free(buf);
return rc;
}
static void wsrep_TOI_end(THD *thd) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment