Cloned DCB authentication data was freed twice

This caused all Tee filter sessions to crash when the branch DCB was closed.
This commit is contained in:
Markus Makela 2016-02-27 13:05:44 +02:00
parent f77afc6374
commit f03865f32a
2 changed files with 13 additions and 2 deletions

View File

@ -369,7 +369,15 @@ dcb_final_free(DCB *dcb)
if (SESSION_STATE_DUMMY != local_session->state)
{
session_free(local_session);
return;
if (local_session->client_dcb == dcb)
{
/** The client DCB is freed once all other DCBs that the session
* uses have been freed. This will guarantee that the authentication
* data will be usable for all DCBs even if the client DCB has already
* been closed. */
return;
}
}
}
dcb_free_all_memory(dcb);

View File

@ -427,7 +427,10 @@ session_free(SESSION *session)
*/
if (session->client_dcb)
{
mysql_auth_free_client_data(session->client_dcb);
if (!DCB_IS_CLONE(session->client_dcb))
{
mysql_auth_free_client_data(session->client_dcb);
}
dcb_free_all_memory(session->client_dcb);
}
/**