# HG changeset patch # User Mark Doliner # Date 1299551267 0 # Node ID 96dffe08f3f72f82c9eef4f0c691dfcdb1f4f9a9 # Parent d2962c2d77916b9b4d08cb2e65ad9ab650cfecfd# Parent 2e0cff411cc95f33a95afb757e362c40194710d9 merge of '2873917d9d4d30d86018ef5da25d8076c9c402ab' and 'c0b910c136c2999321b3ee2969b3e2c60abd11b8' diff -r 2e0cff411cc9 -r 96dffe08f3f7 libpurple/protocols/jabber/jabber.c --- a/libpurple/protocols/jabber/jabber.c Tue Mar 08 02:21:29 2011 +0000 +++ b/libpurple/protocols/jabber/jabber.c Tue Mar 08 02:27:47 2011 +0000 @@ -924,24 +924,25 @@ 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@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 @@ 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 @@ 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 @@ /* 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); - - js->user_jb = jabber_buddy_find(js, username, TRUE); + purple_connection_set_display_name(gc, user); + + 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,