changeset 29756:306c68ade25a

merge of '2397ba22512c2bb9c2e3d67b9b0e38ced723db05' and 'e79c3708cf80d30995721ca847ef81d4542dfc69'
author Paul Aurich <paul@darkrain42.org>
date Mon, 19 Apr 2010 16:05:00 +0000
parents 378cceb9131d (current diff) 9134be6baaef (diff)
children 2ed0041a7b0f
files
diffstat 3 files changed, 25 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/auth.c	Sun Apr 18 22:39:01 2010 +0000
+++ b/libpurple/protocols/jabber/auth.c	Mon Apr 19 16:05:00 2010 +0000
@@ -208,6 +208,11 @@
 		}
 	}
 
+	while (mechanisms) {
+		g_free(mechanisms->data);
+		mechanisms = g_slist_delete_link(mechanisms, mechanisms);
+	}
+
 	if (js->auth_mech == NULL) {
 		/* Found no good mechanisms... */
 		purple_connection_error_reason(js->gc,
--- a/libpurple/protocols/jabber/auth_scram.c	Sun Apr 18 22:39:01 2010 +0000
+++ b/libpurple/protocols/jabber/auth_scram.c	Mon Apr 19 16:05:00 2010 +0000
@@ -301,11 +301,17 @@
 #endif
 
 		ret = jabber_scram_calc_proofs(data, salt, iterations);
-		if (!ret)
+
+		g_string_free(salt, TRUE);
+		salt = NULL;
+		if (!ret) {
+			g_free(nonce);
 			return FALSE;
+		}
 
 		proof = purple_base64_encode((guchar *)data->client_proof->str, data->client_proof->len);
 		*out = g_strdup_printf("c=%s,r=%s,p=%s", "biws", nonce, proof);
+		g_free(nonce);
 		g_free(proof);
 	} else if (data->step == 2) {
 		gchar *server_sig, *enc_server_sig;
@@ -419,7 +425,7 @@
 {
 	JabberScramData *data = js->auth_mech_data;
 	xmlnode *reply;
-	gchar *enc_in, *dec_in;
+	gchar *enc_in, *dec_in = NULL;
 	gchar *enc_out = NULL, *dec_out = NULL;
 	gsize len;
 	JabberSaslState state = JABBER_SASL_STATE_FAIL;
@@ -434,7 +440,6 @@
 	}
 
 	dec_in = (gchar *)purple_base64_decode(enc_in, &len);
-	g_free(enc_in);
 	if (!dec_in || len != strlen(dec_in)) {
 		/* Danger afoot; SCRAM shouldn't contain NUL bytes */
 		reply = xmlnode_new("abort");
@@ -468,6 +473,8 @@
 	state = JABBER_SASL_STATE_CONTINUE;
 
 out:
+	g_free(enc_in);
+	g_free(dec_in);
 	g_free(enc_out);
 	g_free(dec_out);
 
@@ -506,11 +513,13 @@
 	purple_debug_misc("jabber", "decoded success: %s\n", dec_in);
 
 	if (!jabber_scram_feed_parser(data, dec_in, &dec_out) || dec_out != NULL) {
+		g_free(dec_in);
 		g_free(dec_out);
 		*error = g_strdup(_("Invalid challenge from server"));
 		return JABBER_SASL_STATE_FAIL;
 	}
 
+	g_free(dec_in);
 	/* Hooray */
 	return JABBER_SASL_STATE_OK;
 }
--- a/libpurple/protocols/jabber/jabber.c	Sun Apr 18 22:39:01 2010 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Mon Apr 19 16:05:00 2010 +0000
@@ -842,6 +842,7 @@
 		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;
 	}
@@ -850,6 +851,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;
 	}
@@ -858,6 +860,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;
 	}
@@ -3684,6 +3687,11 @@
 	jabber_presence_uninit();
 	jabber_iq_uninit();
 
+#ifdef USE_VV
+	g_signal_handlers_disconnect_by_func(G_OBJECT(purple_media_manager_get()),
+			G_CALLBACK(jabber_caps_broadcast_change), NULL);
+#endif
+
 	jabber_auth_uninit();
 	jabber_features_destroy();
 	jabber_identities_destroy();