diff options
author | Paul Aurich <darkrain42@pidgin.im> | 2010-04-18 20:12:32 +0000 |
---|---|---|
committer | Paul Aurich <darkrain42@pidgin.im> | 2010-04-18 20:12:32 +0000 |
commit | 427dad95a871ed380c4e7de956088c52893b660b (patch) | |
tree | 52880c72593d590e0c577a82c40b64d438cb3e37 | |
parent | 1c8cbf6e47f2b54d8826fd2bd895d328b6197b7b (diff) | |
download | pidgin-427dad95a871ed380c4e7de956088c52893b660b.tar.gz |
jabber: --more leaks
-rw-r--r-- | libpurple/protocols/jabber/auth.c | 5 | ||||
-rw-r--r-- | libpurple/protocols/jabber/auth_scram.c | 15 | ||||
-rw-r--r-- | libpurple/protocols/jabber/jabber.c | 5 |
3 files changed, 22 insertions, 3 deletions
diff --git a/libpurple/protocols/jabber/auth.c b/libpurple/protocols/jabber/auth.c index 1dae3aed98..85d822d86d 100644 --- a/libpurple/protocols/jabber/auth.c +++ b/libpurple/protocols/jabber/auth.c @@ -208,6 +208,11 @@ jabber_auth_start(JabberStream *js, xmlnode *packet) } } + 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, diff --git a/libpurple/protocols/jabber/auth_scram.c b/libpurple/protocols/jabber/auth_scram.c index de1822a944..15127e338d 100644 --- a/libpurple/protocols/jabber/auth_scram.c +++ b/libpurple/protocols/jabber/auth_scram.c @@ -301,11 +301,17 @@ jabber_scram_feed_parser(JabberScramData *data, gchar *in, gchar **out) #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, xmlnode *challenge, xmlnode **out, char { 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, xmlnode *challenge, xmlnode **out, char } 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 @@ scram_handle_challenge(JabberStream *js, xmlnode *challenge, xmlnode **out, char 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, xmlnode *packet, char **error) 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; } diff --git a/libpurple/protocols/jabber/jabber.c b/libpurple/protocols/jabber/jabber.c index 3b30265dc5..79305e9540 100644 --- a/libpurple/protocols/jabber/jabber.c +++ b/libpurple/protocols/jabber/jabber.c @@ -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(); |