From e65bba4b7539484e37c1e53421a5e4b96b9a4131 Mon Sep 17 00:00:00 2001 From: Fabrice Bellet Date: Tue, 13 Jun 2017 16:08:15 +0200 Subject: [PATCH] call-stream: fix a couple of memory leaks --- telepathy-farstream/call-stream.c | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/telepathy-farstream/call-stream.c b/telepathy-farstream/call-stream.c index 91d37d1..aee2959 100644 --- a/telepathy-farstream/call-stream.c +++ b/telepathy-farstream/call-stream.c @@ -148,6 +148,18 @@ tf_call_stream_finalize (GObject *object) g_boxed_free (TP_ARRAY_TYPE_STRING_VARIANT_MAP_LIST, self->relay_info); self->relay_info = NULL; + if (self->candidate_list) + g_boxed_free (TP_ARRAY_TYPE_CANDIDATE_LIST, self->candidate_list); + self->candidate_list = NULL; + + if (self->last_local_username) + g_free (self->last_local_username); + self->last_local_username = NULL; + + if (self->last_local_password) + g_free (self->last_local_password); + self->last_local_password = NULL; + if (G_OBJECT_CLASS (tf_call_stream_parent_class)->finalize) G_OBJECT_CLASS (tf_call_stream_parent_class)->finalize (object); } @@ -1382,8 +1394,7 @@ tf_call_stream_new (TfCallContent *call_content, self->call_content = call_content; self->proxy = g_object_ref (stream_proxy); - tp_proxy_prepare_async (self->proxy, NULL, stream_prepared, - g_object_ref (self)); + tp_proxy_prepare_async (self->proxy, NULL, stream_prepared, self); return self; } @@ -1677,20 +1688,22 @@ tf_call_stream_fail_literal (TfCallStream *self, const gchar *detailed_reason, const gchar *message) { + GValueArray *array; + g_warning ("%s", message); if (self->proxy == NULL) return; - tp_cli_call_stream_interface_media_call_fail ( - self->proxy, -1, - tp_value_array_build (4, + array = tp_value_array_build (4, G_TYPE_UINT, 0, G_TYPE_UINT, reason, G_TYPE_STRING, detailed_reason, G_TYPE_STRING, message, - G_TYPE_INVALID), - NULL, NULL, NULL, NULL); + G_TYPE_INVALID); + tp_cli_call_stream_interface_media_call_fail ( + self->proxy, -1, array, NULL, NULL, NULL, NULL); + g_value_array_free (array); } -- 2.9.4