mysql_client.c:gw_error_client_event & gw_client_hangup_event: added session state check, if session is already closing, don't start redundant call to dcb_close.

mysql_common.c:mysql_protocol_done: added protocol state check. Used not to check it which caused double free of allocated memory.
This commit is contained in:
VilhoRaatikka
2014-08-14 15:15:22 +03:00
parent d3a79ce7c4
commit 77e5525436
5 changed files with 36 additions and 17 deletions

View File

@ -1300,12 +1300,19 @@ static int gw_error_client_event(
STRDCBSTATE(dcb->state),
(session != NULL ? session : NULL))));
if (session != NULL && session->state == SESSION_STATE_STOPPING)
{
goto retblock;
}
#if defined(SS_DEBUG)
LOGIF(LE, (skygw_log_write_flush(
LOGFILE_ERROR,
"Client error event handling.")));
#endif
dcb_close(dcb);
retblock:
return 1;
}
@ -1380,12 +1387,19 @@ gw_client_hangup_event(DCB *dcb)
{
CHK_SESSION(session);
}
if (session != NULL && session->state == SESSION_STATE_STOPPING)
{
goto retblock;
}
#if defined(SS_DEBUG)
LOGIF(LE, (skygw_log_write_flush(
LOGFILE_ERROR,
"Client hangup error handling.")));
#endif
dcb_close(dcb);
retblock:
return 1;
}