summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabrice Bellet <fabrice@bellet.info>2016-07-18 14:30:48 +0200
committerOlivier CrĂȘte <olivier.crete@collabora.com>2016-12-18 11:24:41 -0500
commit93380c723f999ee9d387cbf2de08dbf12e908fec (patch)
tree23264ae7ab8e1bf36341e84fa8a56c216f90f59e
parentaf16393783770a8b7b1cda334fbaa530caa349bb (diff)
downloadtelepathy-farstream-93380c723f999ee9d387cbf2de08dbf12e908fec.tar.gz
fix a couple of memory leaks
https://bugs.freedesktop.org/show_bug.cgi?id=99124
-rw-r--r--telepathy-farstream/call-content.c7
-rw-r--r--telepathy-farstream/call-stream.c7
2 files changed, 11 insertions, 3 deletions
diff --git a/telepathy-farstream/call-content.c b/telepathy-farstream/call-content.c
index 751b606..3f26063 100644
--- a/telepathy-farstream/call-content.c
+++ b/telepathy-farstream/call-content.c
@@ -1194,6 +1194,7 @@ got_content_media_properties (TpProxy *proxy, GHashTable *properties,
g_warning ("Could not set codec preference: %s", myerror->message);
g_clear_error (&myerror);
}
+ g_list_free_full (codec_prefs, (GDestroyNotify)fs_codec_destroy);
}
/* First complete so we get signalled and the preferences can be set, then
@@ -1775,7 +1776,7 @@ fscodecs_to_media_descriptions (TfCallContent *self, GList *codecs)
GPtrArray *tpcodecs = g_ptr_array_new ();
GList *item;
GList *resend_codecs = NULL;
- GHashTable *retval;
+ GHashTable *retval = NULL;
GPtrArray *rtp_hdrext = NULL;
GHashTable *rtcp_fb = NULL;
GPtrArray *interfaces;
@@ -1785,7 +1786,7 @@ fscodecs_to_media_descriptions (TfCallContent *self, GList *codecs)
self->last_sent_codecs, codecs);
if (!self->current_media_description && !resend_codecs)
- return NULL;
+ goto out;
if ((self->current_media_description && self->current_has_rtp_hdrext)
|| self->has_rtp_hdrext)
@@ -1934,6 +1935,8 @@ fscodecs_to_media_descriptions (TfCallContent *self, GList *codecs)
G_TYPE_STRV, interfaces->pdata);
g_ptr_array_free (interfaces, FALSE);
+out:
+ g_ptr_array_unref (tpcodecs);
return retval;
}
diff --git a/telepathy-farstream/call-stream.c b/telepathy-farstream/call-stream.c
index bbec0c9..b0d073d 100644
--- a/telepathy-farstream/call-stream.c
+++ b/telepathy-farstream/call-stream.c
@@ -1430,6 +1430,7 @@ static GValueArray *
fscandidate_to_tpcandidate (TfCallStream *stream, FsCandidate *candidate)
{
GHashTable *extra_info;
+ GValueArray *tpcandidate;
extra_info = tp_asv_new (NULL, NULL);
@@ -1464,12 +1465,16 @@ fscandidate_to_tpcandidate (TfCallStream *stream, FsCandidate *candidate)
}
- return tp_value_array_build (4,
+ tpcandidate = tp_value_array_build (4,
G_TYPE_UINT, candidate->component_id,
G_TYPE_STRING, candidate->ip,
G_TYPE_UINT, candidate->port,
TP_HASH_TYPE_CANDIDATE_INFO, extra_info,
G_TYPE_INVALID);
+
+ g_hash_table_unref (extra_info);
+
+ return tpcandidate;
}
static void