[gnome-online-accounts] Don't leak the GErrors



commit 80346802fd737ebba3de13c4ec07f9eac02b1dfc
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Sep 30 15:57:22 2014 +0200

    Don't leak the GErrors
    
    Fixes: https://bugzilla.gnome.org/737656

 src/daemon/goadaemon.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/src/daemon/goadaemon.c b/src/daemon/goadaemon.c
index c2a77ed..1e5511b 100644
--- a/src/daemon/goadaemon.c
+++ b/src/daemon/goadaemon.c
@@ -785,7 +785,7 @@ get_all_providers_cb (GObject      *source,
                    GOA_ERROR_FAILED, /* TODO: more specific */
                    _("Failed to find a provider for: %s"),
                    data->provider_type);
-      g_dbus_method_invocation_return_gerror (data->invocation, error);
+      g_dbus_method_invocation_take_error (data->invocation, error);
       goto out;
     }
 
@@ -804,7 +804,7 @@ get_all_providers_cb (GObject      *source,
       else
         {
           g_prefix_error (&error, "Error loading file %s: ", path);
-          g_dbus_method_invocation_return_gerror (data->invocation, error);
+          g_dbus_method_invocation_take_error (data->invocation, error);
           goto out;
         }
     }
@@ -816,7 +816,7 @@ get_all_providers_cb (GObject      *source,
           if (!g_key_file_load_from_data (key_file, key_file_data, length, G_KEY_FILE_KEEP_COMMENTS, &error))
             {
               g_prefix_error (&error, "Error parsing key-value-file %s: ", path);
-              g_dbus_method_invocation_return_gerror (data->invocation, error);
+              g_dbus_method_invocation_take_error (data->invocation, error);
               goto out;
             }
         }
@@ -857,7 +857,7 @@ get_all_providers_cb (GObject      *source,
   if (key_file_data == NULL)
     {
       g_prefix_error (&error, "Error generating key-value-file: ");
-      g_dbus_method_invocation_return_gerror (data->invocation, error);
+      g_dbus_method_invocation_take_error (data->invocation, error);
       goto out;
     }
 
@@ -868,7 +868,7 @@ get_all_providers_cb (GObject      *source,
                             &error))
     {
       g_prefix_error (&error, "Error writing key-value-file %s: ", path);
-      g_dbus_method_invocation_return_gerror (data->invocation, error);
+      g_dbus_method_invocation_take_error (data->invocation, error);
       goto out;
     }
 
@@ -1006,7 +1006,7 @@ on_account_handle_remove (GoaAccount            *account,
   if (data == NULL)
     {
       g_prefix_error (&error, "Error generating key-value-file: ");
-      g_dbus_method_invocation_return_gerror (invocation, error);
+      g_dbus_method_invocation_take_error (invocation, error);
       goto out;
     }
 
@@ -1017,7 +1017,7 @@ on_account_handle_remove (GoaAccount            *account,
                             &error))
     {
       g_prefix_error (&error, "Error writing key-value-file %s: ", path);
-      g_dbus_method_invocation_return_gerror (invocation, error);
+      g_dbus_method_invocation_take_error (invocation, error);
       goto out;
     }
 
@@ -1029,7 +1029,7 @@ on_account_handle_remove (GoaAccount            *account,
                            GOA_ERROR,
                            GOA_ERROR_FAILED, /* TODO: more specific */
                            _("ProviderType property is not set for account"));
-      g_dbus_method_invocation_return_gerror (invocation, error);
+      g_dbus_method_invocation_take_error (invocation, error);
       goto out;
     }
 
@@ -1042,14 +1042,14 @@ on_account_handle_remove (GoaAccount            *account,
                    GOA_ERROR_FAILED, /* TODO: more specific */
                    _("Failed to find a provider for: %s"),
                    provider_type);
-      g_dbus_method_invocation_return_gerror (invocation, error);
+      g_dbus_method_invocation_take_error (invocation, error);
       goto out;
     }
 
   error = NULL;
   if (!goa_utils_delete_credentials_sync (provider, account, NULL, &error))
     {
-      g_dbus_method_invocation_return_gerror (invocation, error);
+      g_dbus_method_invocation_take_error (invocation, error);
       goto out;
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]