Blob Blame History Raw
From 5e06329c3668da308055e5cd4b75730b45389124 Mon Sep 17 00:00:00 2001
From: Debarshi Ray <debarshir@gnome.org>
Date: Wed, 27 May 2015 19:01:44 +0200
Subject: [PATCH] daemon: Don't leak the GoaProvider

https://bugzilla.gnome.org/show_bug.cgi?id=693578
---
 src/daemon/goadaemon.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/daemon/goadaemon.c b/src/daemon/goadaemon.c
index 9d5543d..56292b1 100644
--- a/src/daemon/goadaemon.c
+++ b/src/daemon/goadaemon.c
@@ -1158,7 +1158,7 @@ on_account_handle_ensure_credentials (GoaAccount            *account,
                                       gpointer               user_data)
 {
   GoaDaemon *daemon = GOA_DAEMON (user_data);
-  GoaProvider *provider;
+  GoaProvider *provider = NULL;
   GoaObject *object;
 
   object = GOA_OBJECT (g_dbus_interface_get_object (G_DBUS_INTERFACE (account)));
@@ -1181,5 +1181,6 @@ on_account_handle_ensure_credentials (GoaAccount            *account,
                                    ensure_data_new (daemon, object, invocation));
 
  out:
+  g_clear_object (&provider);
   return TRUE; /* invocation was handled */
 }
-- 
2.1.0