Fixed possible null pointer dereferences in mysql_backend.
This commit is contained in:
@ -1159,13 +1159,14 @@ gw_backend_close(DCB *dcb)
|
|||||||
* but client's close and adding client's DCB to zombies list is executed
|
* but client's close and adding client's DCB to zombies list is executed
|
||||||
* only if client's DCB's state does _not_ change in parallel.
|
* only if client's DCB's state does _not_ change in parallel.
|
||||||
*/
|
*/
|
||||||
|
if(session != NULL)
|
||||||
|
{
|
||||||
spinlock_acquire(&session->ses_lock);
|
spinlock_acquire(&session->ses_lock);
|
||||||
/**
|
/**
|
||||||
* If session->state is STOPPING, start closing client session.
|
* If session->state is STOPPING, start closing client session.
|
||||||
* Otherwise only this backend connection is closed.
|
* Otherwise only this backend connection is closed.
|
||||||
*/
|
*/
|
||||||
if (session != NULL &&
|
if (session->state == SESSION_STATE_STOPPING &&
|
||||||
session->state == SESSION_STATE_STOPPING &&
|
|
||||||
session->client != NULL)
|
session->client != NULL)
|
||||||
{
|
{
|
||||||
if (session->client->state == DCB_STATE_POLLING)
|
if (session->client->state == DCB_STATE_POLLING)
|
||||||
@ -1184,6 +1185,7 @@ gw_backend_close(DCB *dcb)
|
|||||||
{
|
{
|
||||||
spinlock_release(&session->ses_lock);
|
spinlock_release(&session->ses_lock);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user