]> git.0d.be Git - empathy.git/commitdiff
Check if property is writable before setting it. Fix leaks
authorXavier Claessens <xclaesse@src.gnome.org>
Tue, 11 Mar 2008 12:23:10 +0000 (12:23 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Tue, 11 Mar 2008 12:23:10 +0000 (12:23 +0000)
svn path=/trunk/; revision=774

libempathy/empathy-tp-chat.c

index 7ae3168c1146a84dbccc9078cab47c86cac68a6b..dc90f28e2c65482d230f594519b47faecd6b4090 100644 (file)
@@ -512,6 +512,10 @@ empathy_tp_chat_set_property (EmpathyTpChat *chat,
                        GValue       id = {0, };
                        GValue       dest_value = {0, };
 
                        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);
                        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));
 
                                                                         "Seting property", NULL,
                                                                         G_OBJECT (chat));
 
+                       g_ptr_array_free (properties, TRUE);
+                       g_value_array_free (prop);
+
                        break;
                }
        }
                        break;
                }
        }