pidgin: e2dae1bf: jabber: Stop fall-through on connection ...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Sun Aug 2 01:41:30 EDT 2009


-----------------------------------------------------------------
Revision: e2dae1bf841b14d3908cb5cd922645f697a66c6b
Ancestor: bdf4c8dd2356b5bd7b104d0c4c9d7264752d0132
Author: darkrain42 at pidgin.im
Date: 2009-08-01T21:45:24
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/e2dae1bf841b14d3908cb5cd922645f697a66c6b

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

ChangeLog: 

jabber: Stop fall-through on connection error.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jabber.c	244b38b7bac634c50f3c6173de33ec413698fe7c
+++ libpurple/protocols/jabber/jabber.c	ee8c9879f144270c9d8b94d8b5393d596024e756
@@ -132,14 +132,20 @@ static void jabber_bind_result_cb(Jabber
 		xmlnode *jid;
 		char *full_jid;
 		if((jid = xmlnode_get_child(bind, "jid")) && (full_jid = xmlnode_get_data(jid))) {
-			JabberBuddy *my_jb = NULL;
+			JabberBuddy *my_jb;
 			jabber_id_free(js->user);
-			if(!(js->user = jabber_id_new(full_jid))) {
+
+			js->user = jabber_id_new(full_jid);
+			if (js->user == NULL) {
 				purple_connection_error_reason(js->gc,
 					PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 					_("Invalid response from server"));
+				g_free(full_jid);
+				return;
 			}
-			if((my_jb = jabber_buddy_find(js, full_jid, TRUE)))
+
+			my_jb = jabber_buddy_find(js, full_jid, TRUE);
+			if (my_jb)
 				my_jb->subscription |= JABBER_SUB_BOTH;
 
 			purple_connection_set_display_name(js->gc, full_jid);


More information about the Commits mailing list