libpurple/protocols/jabber/jingle/iceudp.c

branch
release-2.x.y
changeset 39724
72a35ff95941
parent 38259
c593fc9f5438
child 39731
ea0961a2cf96
--- a/libpurple/protocols/jabber/jingle/iceudp.c	Sat Jun 29 00:02:51 2019 +0200
+++ b/libpurple/protocols/jabber/jingle/iceudp.c	Tue Jul 02 14:04:49 2019 +0200
@@ -89,6 +89,7 @@
 
 	g_free(candidate->username);
 	g_free(candidate->password);
+	g_free(candidate);
 }
 
 GType
@@ -192,9 +193,27 @@
 static void
 jingle_iceudp_finalize (GObject *iceudp)
 {
-/*	JingleIceUdpPrivate *priv = JINGLE_ICEUDP_GET_PRIVATE(iceudp); */
+	JingleIceUdpPrivate *priv = JINGLE_ICEUDP_GET_PRIVATE(iceudp);
+	GList *iter;
+
 	purple_debug_info("jingle","jingle_iceudp_finalize\n");
 
+	iter = priv->local_candidates;
+	for (; iter; iter = g_list_next(iter)) {
+		JingleIceUdpCandidate *c = iter->data;
+		g_boxed_free(JINGLE_TYPE_ICEUDP_CANDIDATE, c);
+	}
+	g_list_free (priv->local_candidates);
+	iter = priv->remote_candidates;
+	for (; iter; iter = g_list_next(iter)) {
+		JingleIceUdpCandidate *c = iter->data;
+		g_boxed_free(JINGLE_TYPE_ICEUDP_CANDIDATE, c);
+	}
+	g_list_free (priv->remote_candidates);
+
+	priv->local_candidates = NULL;
+	priv->remote_candidates = NULL;
+
 	G_OBJECT_CLASS(parent_class)->finalize(iceudp);
 }
 

mercurial