Added a missing NULL check.

This commit is contained in:
Markus Makela
2015-08-14 09:54:51 +03:00
parent 65bb80a3f1
commit 185ff4343c

View File

@ -633,7 +633,7 @@ char** tokenize_string(char* str)
*/ */
int internalRoute(DCB* dcb) int internalRoute(DCB* dcb)
{ {
if(dcb->dcb_readqueue) if(dcb->dcb_readqueue && dcb->session)
{ {
GWBUF* tmp = dcb->dcb_readqueue; GWBUF* tmp = dcb->dcb_readqueue;
void* rinst = dcb->session->service->router_instance; void* rinst = dcb->session->service->router_instance;
@ -652,7 +652,7 @@ int internalRoute(DCB* dcb)
*/ */
int internalReply(DCB* dcb) int internalReply(DCB* dcb)
{ {
if(dcb->dcb_readqueue) if(dcb->dcb_readqueue && dcb->session)
{ {
GWBUF* tmp = dcb->dcb_readqueue; GWBUF* tmp = dcb->dcb_readqueue;
dcb->dcb_readqueue = NULL; dcb->dcb_readqueue = NULL;