[gnome-online-accounts] daemon: Don't leak the provider when coalescing EnsureCredential calls



commit 37f949cb858061e3c298207c78dae6f8ec62616c
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Jan 5 18:18:22 2017 +0100

    daemon: Don't leak the provider when coalescing EnsureCredential calls
    
    https://bugzilla.gnome.org/show_bug.cgi?id=765121

 src/daemon/goadaemon.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/daemon/goadaemon.c b/src/daemon/goadaemon.c
index 5873806..4cae3e3 100644
--- a/src/daemon/goadaemon.c
+++ b/src/daemon/goadaemon.c
@@ -1736,12 +1736,12 @@ goa_daemon_check_credentials (GoaDaemon *self)
 
       account = goa_object_peek_account (object);
       if (account == NULL)
-        continue;
+        goto cleanup_and_continue;
 
       provider_type = goa_account_get_provider_type (account);
       provider = goa_provider_get_for_provider_type (provider_type);
       if (provider == NULL)
-        continue;
+        goto cleanup_and_continue;
 
       id = goa_account_get_id (account);
       provider_type = goa_account_get_provider_type (account);
@@ -1758,7 +1758,7 @@ goa_daemon_check_credentials (GoaDaemon *self)
                    timestamp,
                    provider_type,
                    id);
-          continue;
+          goto cleanup_and_continue;
         }
 
       data = object_invocation_data_new (object, NULL);
@@ -1768,6 +1768,7 @@ goa_daemon_check_credentials (GoaDaemon *self)
       g_task_set_task_data (task, data, (GDestroyNotify) object_invocation_data_unref);
       g_queue_push_tail (self->ensure_credentials_queue, g_object_ref (task));
 
+    cleanup_and_continue:
       g_clear_object (&provider);
       g_clear_object (&task);
     }


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