pidgin: 2873917d: disapproval of revision '385542a8270ac30...

markdoliner at pidgin.im markdoliner at pidgin.im
Mon Mar 7 21:30:33 EST 2011


----------------------------------------------------------------------
Revision: 2873917d9d4d30d86018ef5da25d8076c9c402ab
Parent:   385542a8270ac30d2121b533494264a28cd04423
Author:   markdoliner at pidgin.im
Date:     03/07/11 21:27:25
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/2873917d9d4d30d86018ef5da25d8076c9c402ab

Changelog: 

disapproval of revision '385542a8270ac30d2121b533494264a28cd04423'

Changes against parent 385542a8270ac30d2121b533494264a28cd04423

  patched  libpurple/protocols/jabber/jabber.c

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jabber.c	fa87ad671cebe79ae7b403e233e9cf75d9dc2530
+++ libpurple/protocols/jabber/jabber.c	ad50987594a75a4e32625b8192cb0ab9412e310a
@@ -924,24 +924,25 @@ jabber_stream_new(PurpleAccount *account
 	PurpleConnection *gc = purple_account_get_connection(account);
 	JabberStream *js;
 	PurplePresence *presence;
-	const gchar *username;
+	gchar *user;
 	gchar *slash;
 
 	js = gc->proto_data = g_new0(JabberStream, 1);
 	js->gc = gc;
 	js->fd = -1;
 
-	username = purple_account_get_username(account);
+	user = g_strdup(purple_account_get_username(account));
 	/* jabber_id_new doesn't accept "user at domain/" as valid */
-	slash = strchr(username, '/');
+	slash = strchr(user, '/');
 	if (slash && *(slash + 1) == '\0')
 		*slash = '\0';
-	js->user = jabber_id_new(username);
+	js->user = jabber_id_new(user);
 
 	if (!js->user) {
 		purple_connection_error_reason(gc,
 			PURPLE_CONNECTION_ERROR_INVALID_SETTINGS,
 			_("Invalid XMPP ID"));
+		g_free(user);
 		/* Destroying the connection will free the JabberStream */
 		return NULL;
 	}
@@ -950,6 +951,7 @@ jabber_stream_new(PurpleAccount *account
 		purple_connection_error_reason(gc,
 			PURPLE_CONNECTION_ERROR_INVALID_SETTINGS,
 			_("Invalid XMPP ID. Username portion must be set."));
+		g_free(user);
 		/* Destroying the connection will free the JabberStream */
 		return NULL;
 	}
@@ -958,6 +960,7 @@ jabber_stream_new(PurpleAccount *account
 		purple_connection_error_reason(gc,
 			PURPLE_CONNECTION_ERROR_INVALID_SETTINGS,
 			_("Invalid XMPP ID. Domain must be set."));
+		g_free(user);
 		/* Destroying the connection will free the JabberStream */
 		return NULL;
 	}
@@ -968,9 +971,10 @@ jabber_stream_new(PurpleAccount *account
 	/* This is overridden during binding, but we need it here
 	 * in case the server only does legacy non-sasl auth!.
 	 */
-	purple_connection_set_display_name(gc, username);
+	purple_connection_set_display_name(gc, user);
 
-	js->user_jb = jabber_buddy_find(js, username, TRUE);
+	js->user_jb = jabber_buddy_find(js, user, TRUE);
+	g_free(user);
 	if (!js->user_jb) {
 		/* This basically *can't* fail, but for good measure... */
 		purple_connection_error_reason(gc,


More information about the Commits mailing list