]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
D-Bus: Fix memory leak in introspection handler
authorJürg Billeter <j@bitron.ch>
Wed, 8 Apr 2009 17:29:44 +0000 (19:29 +0200)
committerJürg Billeter <j@bitron.ch>
Wed, 8 Apr 2009 17:29:44 +0000 (19:29 +0200)
gobject/valadbusservermodule.vala

index c9c2643e28eef3d91507a476cd59c8f1ee80ece5..936d33a3992c6a321f5602077f98a7c8b95a4a7e 100644 (file)
@@ -1067,6 +1067,10 @@ internal class Vala.DBusServerModule : DBusClientModule {
                cfor.add_iterator (new CCodeUnaryExpression (CCodeUnaryOperator.POSTFIX_INCREMENT, new CCodeIdentifier ("i")));
                block.add_statement (cfor);
 
+               var list_free_call = new CCodeFunctionCall (new CCodeIdentifier ("dbus_free_string_array"));
+               list_free_call.add_argument (new CCodeIdentifier ("children"));
+               block.add_statement (new CCodeExpressionStatement (list_free_call));
+
                xml_data = "</node>\n";
                str_call = new CCodeFunctionCall (new CCodeIdentifier ("g_string_append"));
                str_call.add_argument (new CCodeIdentifier ("xml_data"));