Description: client_dispose (lib/client.c) which closes a connection of a sasl client frees mech_list if the head of the list differs from the head of the global cmechlist->mech_list. But there was a possibility that the list appears in the middle of the global mech list. By freeing the mech, it crashed a multi-threaded sasl client.
This patch checks each mech if it is in the global mech list or not. Only if it is not, the mech is freed.
Description: client_dispose (lib/client.c) which closes a connection of a sasl client frees mech_list if the head of the list differs from the head of the global cmechlist->mech_list. But there was a possibility that the list appears in the middle of the global mech list. By freeing the mech, it crashed a multi-threaded sasl client.
This patch checks each mech if it is in the global mech list or not. Only if it is not, the mech is freed.