MXS-1977: Fix protocol and readwritesplit memory leaks

The protocol could leak memory in rare cases where several commands were
queued at the same time. Readwritesplit also didn't free the memory it
acquired via qc_get_table_names.
This commit is contained in:
Markus Mäkelä
2018-07-16 05:53:44 +03:00
parent 9b1d1303ce
commit 4fb4ed416b
2 changed files with 24 additions and 15 deletions

View File

@ -637,8 +637,9 @@ void protocol_remove_srv_command(MySQLProtocol* p)
}
else
{
p->protocol_command = *(s->scom_next);
server_command_t tmp = *(s->scom_next);
MXS_FREE(s->scom_next);
p->protocol_command = tmp;
}
}