From eeae2f62192b97d5509ae16ae6cabbe29ef5c455 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Tue, 11 Mar 2008 12:23:10 +0000 Subject: Check if property is writable before setting it. Fix leaks svn path=/trunk/; revision=774 --- libempathy/empathy-tp-chat.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libempathy') diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c index 7ae3168c1..dc90f28e2 100644 --- a/libempathy/empathy-tp-chat.c +++ b/libempathy/empathy-tp-chat.c @@ -512,6 +512,10 @@ empathy_tp_chat_set_property (EmpathyTpChat *chat, GValue id = {0, }; GValue dest_value = {0, }; + if (!(property->flags & TP_PROPERTY_FLAG_WRITE)) { + break; + } + g_value_init (&id, G_TYPE_UINT); g_value_init (&dest_value, G_TYPE_VALUE); g_value_set_uint (&id, property->id); @@ -532,6 +536,9 @@ empathy_tp_chat_set_property (EmpathyTpChat *chat, "Seting property", NULL, G_OBJECT (chat)); + g_ptr_array_free (properties, TRUE); + g_value_array_free (prop); + break; } } -- cgit v1.2.3