]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Avoid early return on sync dbus methods returning an error
authorCarlos Garnacho <carlosg@gnome.org>
Mon, 6 Mar 2017 12:17:40 +0000 (13:17 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 6 Mar 2017 13:16:08 +0000 (14:16 +0100)
If there are arguments that need freeing, we need to fall through the
_error label, if there is any.

https://bugzilla.gnome.org/show_bug.cgi?id=778540

codegen/valagdbusservermodule.vala

index 2cb42710ed2f842e505bece6e0051735ac32f0e9..d0c87fd64f403760dcf0fc87bf897959192e1e80 100644 (file)
@@ -240,7 +240,11 @@ public class Vala.GDBusServerModule : GDBusClientModule {
                                return_error.add_argument (new CCodeIdentifier ("error"));
                                ccode.add_expression (return_error);
 
-                               ccode.add_return ();
+                               if (need_goto_label) {
+                                       ccode.add_goto ("_error");
+                               } else {
+                                       ccode.add_return ();
+                               }
 
                                ccode.close ();
                        }