# HG changeset patch # User Elliott Sales de Andrade # Date 1278200759 0 # Node ID 8c1a2ef5a71375aff3926653a2790a4343b54f5f # Parent a14c2e81fcf0bc4061e270e61739ac81bb4d23eb Destroy a DC if its corresponding slpcall is going away and it hasn't established itself yet. Otherwise, it might timeout later and try to access the old slpcall. Fixes #12072. diff -r a14c2e81fcf0 -r 8c1a2ef5a713 libpurple/protocols/msn/slplink.c --- a/libpurple/protocols/msn/slplink.c Fri Jul 02 00:32:20 2010 +0000 +++ b/libpurple/protocols/msn/slplink.c Sat Jul 03 23:45:59 2010 +0000 @@ -214,11 +214,16 @@ slplink->swboard = NULL; } - /* The slplink has no slpcalls in it, release it from the DC. */ - if (slplink->slp_calls == NULL && slplink->dc != NULL) { - slplink->dc->slplink = NULL; - msn_dc_destroy(slplink->dc); - slplink->dc = NULL; + if (slplink->dc != NULL) { + if ((slplink->dc->state != DC_STATE_ESTABLISHED && slplink->dc->slpcall == slpcall) + || (slplink->slp_calls == NULL)) { + /* The DC is not established and its corresponding slpcall is dead, + * or the slplink has no slpcalls in it and no longer needs the DC. + */ + slplink->dc->slplink = NULL; + msn_dc_destroy(slplink->dc); + slplink->dc = NULL; + } } }