pidgin: d5aa8b56: Fix picking up SI streamhosts from login...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Wed Jul 15 00:30:42 EDT 2009


-----------------------------------------------------------------
Revision: d5aa8b561c618705b25a69e3c0aaea812f4abee6
Ancestor: 03e0254c6871c4730755a200d34d4adacdf40c66
Author: darkrain42 at pidgin.im
Date: 2009-07-14T22:47:42
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/d5aa8b561c618705b25a69e3c0aaea812f4abee6

Modified files:
        libpurple/protocols/jabber/disco.c

ChangeLog: 

Fix picking up SI streamhosts from login server and plug a leak.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/disco.c	5dca8e6a529e5caf817e7e682b1b2bb49e0bd10d
+++ libpurple/protocols/jabber/disco.c	8f912773709e9faeb4b51cef302e1d021e8c421a
@@ -297,7 +297,8 @@ static void jabber_disco_info_cb(JabberS
 		if(jbr)
 			jbr->capabilities = capabilities;
 
-		jdicd->callback(js, from, capabilities, jdicd->data);
+		if (jdicd && jdicd->callback)
+			jdicd->callback(js, from, capabilities, jdicd->data);
 	} else { /* type == JABBER_IQ_ERROR or query == NULL */
 		JabberID *jid;
 		JabberBuddy *jb;
@@ -313,8 +314,11 @@ static void jabber_disco_info_cb(JabberS
 		if(jbr)
 			capabilities = jbr->capabilities;
 
-		jdicd->callback(js, from, capabilities, jdicd->data);
+		if (jdicd && jdicd->callback)
+			jdicd->callback(js, from, capabilities, jdicd->data);
 	}
+
+	g_free(jdicd);
 }
 
 void jabber_disco_items_parse(JabberStream *js, const char *from,
@@ -515,6 +519,7 @@ jabber_disco_server_items_result_cb(Jabb
 
 		iq = jabber_iq_new_query(js, JABBER_IQ_GET, "http://jabber.org/protocol/disco#info");
 		xmlnode_set_attrib(iq->node, "to", jid);
+		jabber_iq_set_callback(iq, jabber_disco_info_cb, NULL);
 		jabber_iq_send(iq);
 	}
 }


More information about the Commits mailing list