From 1c7c849d34ee89a030fe0d85e326311741a0f3d1 Mon Sep 17 00:00:00 2001
From: Frederic Martinsons <frederic.martinsons@sigfox.com>
Date: Tue, 26 Jan 2021 15:43:46 +0100
Subject: [PATCH] Correct memory leaks of error in completion case.

Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>

Conflict:NA
Reference:https://github.com/GNOME/glib/commit/1c7c849d34ee89a030fe0d85e326311741a0f3d1

---
 gio/gdbus-tool.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/gio/gdbus-tool.c b/gio/gdbus-tool.c
index 5cb80b45f7..06f61cfac6 100644
--- a/gio/gdbus-tool.c
+++ b/gio/gdbus-tool.c
@@ -681,8 +681,8 @@ handle_emit (gint        *argc,
       else
         {
           g_printerr (_("Error connecting: %s\n"), error->message);
-          g_error_free (error);
         }
+      g_error_free (error);
       goto out;
     }
 
@@ -995,8 +995,8 @@ handle_call (gint        *argc,
       else
         {
           g_printerr (_("Error connecting: %s\n"), error->message);
-          g_error_free (error);
         }
+      g_error_free (error);
       goto out;
     }
 
@@ -1825,8 +1825,8 @@ handle_introspect (gint        *argc,
       else
         {
           g_printerr (_("Error connecting: %s\n"), error->message);
-          g_error_free (error);
         }
+      g_error_free (error);
       goto out;
     }
 
@@ -2057,8 +2057,8 @@ handle_monitor (gint        *argc,
       else
         {
           g_printerr (_("Error connecting: %s\n"), error->message);
-          g_error_free (error);
         }
+      g_error_free (error);
       goto out;
     }
 
@@ -2277,8 +2277,8 @@ handle_wait (gint        *argc,
       else
         {
           g_printerr (_("Error connecting: %s\n"), error->message);
-          g_error_free (error);
         }
+      g_error_free (error);
       goto out;
     }
 
