# HG changeset patch # User Paul Aurich # Date 1245710769 0 # Node ID 0405276c669876ea0a807676f50a86c0c294b982 # Parent ef9e68020265499e264c3be291836c83d1a38f3b Fix a lost reference when we only fetch an unknown ext. diff -r ef9e68020265 -r 0405276c6698 libpurple/protocols/jabber/caps.c --- a/libpurple/protocols/jabber/caps.c Mon Jun 22 21:31:54 2009 +0000 +++ b/libpurple/protocols/jabber/caps.c Mon Jun 22 22:46:09 2009 +0000 @@ -589,9 +589,7 @@ } userdata = g_new0(jabber_caps_cbplususerdata, 1); - /* This ref is given to fetching the basic node#ver info if we need it - * or unrefed at the bottom of this function */ - cbplususerdata_ref(userdata); + /* We start out with 0 references. Every query takes one */ userdata->cb = cb; userdata->cb_data = user_data; userdata->who = g_strdup(who); @@ -617,6 +615,8 @@ g_free(nodever); xmlnode_set_attrib(iq->node, "to", who); + cbplususerdata_ref(userdata); + jabber_iq_set_callback(iq, jabber_caps_client_iqcb, userdata); jabber_iq_send(iq); } @@ -669,7 +669,11 @@ } if (userdata->info && userdata->extOutstanding == 0) { + /* We have everything we need right now */ jabber_caps_get_info_complete(userdata); + + /* We need to destroy the structure, but it has 0 refs, so fake it. */ + userdata->ref = 1; cbplususerdata_unref(userdata); } }