[gnome-keyring/wip/gdbus: 13/18] dbus: cleanup error handling



commit f7807e4354765c6b7ad88f6b88a6d25cbbb0c399
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Sun Nov 9 11:21:58 2014 -0800

    dbus: cleanup error handling

 daemon/dbus/gkd-dbus.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/daemon/dbus/gkd-dbus.c b/daemon/dbus/gkd-dbus.c
index 069bf8d..743995f 100644
--- a/daemon/dbus/gkd-dbus.c
+++ b/daemon/dbus/gkd-dbus.c
@@ -134,6 +134,7 @@ gkd_dbus_singleton_acquire (gboolean *acquired)
        GVariant *acquire_variant;
        guint res;
        GError *error = NULL;
+       GkdOrgGnomeKeyringDaemon *skeleton;
 
        g_assert (acquired);
 
@@ -142,8 +143,7 @@ gkd_dbus_singleton_acquire (gboolean *acquired)
 
        /* First register the object */
        if (!object_registered) {
-               GError *error = NULL;
-               GkdOrgGnomeKeyringDaemon *skeleton = gkd_org_gnome_keyring_daemon_skeleton_new ();
+               skeleton = gkd_org_gnome_keyring_daemon_skeleton_new ();
 
                g_signal_connect (skeleton, "handle-get-control-directory",
                                  G_CALLBACK (handle_get_control_directory), NULL);
@@ -158,7 +158,7 @@ gkd_dbus_singleton_acquire (gboolean *acquired)
                        egg_cleanup_register (cleanup_singleton, skeleton);
                } else {
                        g_message ("couldn't register dbus object path: %s", error->message);
-                       g_error_free (error);
+                       g_clear_error (&error);
                }
        }
 


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