MXS-2183: Fix memory leaks
Under heavy load some of the basic network operations could fail which led to some of the allocated memory to leak. Also the backend protocol never freed the current protocol command if it was not completed. This would happen if a user executed a session command as the first command but backend authentication would fail.
This commit is contained in:
@ -105,6 +105,16 @@ bool mysql_protocol_done(DCB* dcb)
|
||||
|
||||
gwbuf_free(p->stored_query);
|
||||
|
||||
server_command_t* s = &p->protocol_command;
|
||||
|
||||
while (s->scom_next)
|
||||
{
|
||||
server_command_t tmp = *(s->scom_next);
|
||||
MXS_FREE(s->scom_next);
|
||||
p->protocol_command = tmp;
|
||||
s = &p->protocol_command;
|
||||
}
|
||||
|
||||
p->protocol_state = MYSQL_PROTOCOL_DONE;
|
||||
rval = true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user