pidgin: e79c3708: jabber: --more leaks

darkrain42 at pidgin.im darkrain42 at pidgin.im
Mon Apr 19 12:11:00 EDT 2010


-----------------------------------------------------------------
Revision: e79c3708cf80d30995721ca847ef81d4542dfc69
Ancestor: 26d70896cd8469bcc0d8be24879fe0a43c10d163
Author: darkrain42 at pidgin.im
Date: 2010-04-18T20:12:32
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/e79c3708cf80d30995721ca847ef81d4542dfc69

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

ChangeLog: 

jabber: --more leaks

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/auth.c	27d26aa0c5566410b60ba14d437a613f727c001e
+++ libpurple/protocols/jabber/auth.c	2b7bba5a3562de2af842c4a4e33b10e41be809bd
@@ -208,6 +208,11 @@ jabber_auth_start(JabberStream *js, xmln
 		}
 	}
 
+	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,
============================================================
--- libpurple/protocols/jabber/auth_scram.c	586e9ec949cf578d39ffdb85c6f2e3e63c455f0a
+++ libpurple/protocols/jabber/auth_scram.c	af68529a143c5c95b25c94cdf5fd82bb7a8d3a0e
@@ -301,11 +301,17 @@ jabber_scram_feed_parser(JabberScramData
 #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 @@ scram_handle_challenge(JabberStream *js,
 {
 	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 @@ scram_handle_challenge(JabberStream *js,
 	}
 
 	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 @@ out:
 	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 @@ scram_handle_success(JabberStream *js, x
 	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;
 }
============================================================
--- libpurple/protocols/jabber/jabber.c	b31e6bc045c48b22aed184632c562424cb0dfb26
+++ libpurple/protocols/jabber/jabber.c	4be8d9605180030e401a550203cc840afce68ee0
@@ -3687,6 +3687,11 @@ jabber_do_uninit(void)
 	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();


More information about the Commits mailing list