Fix crash on session allocation failure
The the return value was used before it was checked.
This commit is contained in:
@ -700,14 +700,13 @@ gw_read_do_authentication(DCB *dcb, GWBUF *read_buffer, int nbytes_read)
|
|||||||
MXS_SESSION *session =
|
MXS_SESSION *session =
|
||||||
session_alloc_with_id(dcb->service, dcb, protocol->thread_id);
|
session_alloc_with_id(dcb->service, dcb, protocol->thread_id);
|
||||||
|
|
||||||
// For the time being only the sql_mode is stored in MXS_SESSION::client_protocol_data.
|
|
||||||
session->client_protocol_data = QC_SQL_MODE_DEFAULT;
|
|
||||||
|
|
||||||
if (session != NULL)
|
if (session != NULL)
|
||||||
{
|
{
|
||||||
CHK_SESSION(session);
|
CHK_SESSION(session);
|
||||||
ss_dassert(session->state != SESSION_STATE_ALLOC &&
|
ss_dassert(session->state != SESSION_STATE_ALLOC &&
|
||||||
session->state != SESSION_STATE_DUMMY);
|
session->state != SESSION_STATE_DUMMY);
|
||||||
|
// For the time being only the sql_mode is stored in MXS_SESSION::client_protocol_data.
|
||||||
|
session->client_protocol_data = QC_SQL_MODE_DEFAULT;
|
||||||
protocol->protocol_auth_state = MXS_AUTH_STATE_COMPLETE;
|
protocol->protocol_auth_state = MXS_AUTH_STATE_COMPLETE;
|
||||||
ss_debug(bool check = ) mxs_worker_register_session(session);
|
ss_debug(bool check = ) mxs_worker_register_session(session);
|
||||||
ss_dassert(check);
|
ss_dassert(check);
|
||||||
|
Reference in New Issue
Block a user