dcb_close sets some session fields to NULL:

dcb->session->client = NULL;

dcb->session = NULL;

There is a local copy of dcb->seesion before setting it to NULL
This commit is contained in:
Massimiliano Pinto
2013-09-02 19:33:55 +02:00
parent 31cda5ad65
commit f80bb51db1

View File

@ -649,15 +649,18 @@ dcb_close(DCB *dcb)
pthread_self()); pthread_self());
} }
} }
dcb->session->client = NULL;
} }
if (dcb->session) { if (dcb->session) {
session_free(dcb->session); SESSION *local_session = dcb->session;
dcb->session = NULL;
session_free(local_session);
skygw_log_write_flush( skygw_log_write_flush(
LOGFILE_TRACE, LOGFILE_TRACE,
"%lu [dcb_close] DCB %p freed session %p", "%lu [dcb_close] DCB %p freed session %p",
pthread_self(), pthread_self(),
dcb, dcb,
dcb->session); local_session);
} }
dcb_free(dcb); dcb_free(dcb);
} }