Mercurial > pidgin
diff libpurple/protocols/jabber/google.c @ 28360:ed88200c79ee
A leak fix in the candidate list, and some code simplification.
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Sat, 10 Oct 2009 19:44:44 +0000 |
parents | 67a97fca157c |
children | 51d507e6c8f3 |
line wrap: on
line diff
--- a/libpurple/protocols/jabber/google.c Sat Oct 10 03:53:59 2009 +0000 +++ b/libpurple/protocols/jabber/google.c Sat Oct 10 19:44:44 2009 +0000 @@ -95,14 +95,14 @@ gchar *participant, GoogleSession *session) { GList *candidates = purple_media_get_local_candidates( - session->media, session_id, session->remote_jid); + session->media, session_id, session->remote_jid), *iter; PurpleMediaCandidate *transport; gboolean video = FALSE; if (!strcmp(session_id, "google-video")) video = TRUE; - for (;candidates;candidates = candidates->next) { + for (iter = candidates; iter; iter = iter->next) { JabberIq *iq; gchar *ip, *port, *username, *password; gchar pref[16]; @@ -110,7 +110,7 @@ xmlnode *sess; xmlnode *candidate; guint component_id; - transport = (PurpleMediaCandidate*)(candidates->data); + transport = PURPLE_MEDIA_CANDIDATE(iter->data); component_id = purple_media_candidate_get_component_id( transport); @@ -168,6 +168,7 @@ jabber_iq_send(iq); } + purple_media_candidate_list_free(candidates); } static void