[gnome-online-accounts] kerberos: refactor register_error_domain



commit 0ab3d27119d724df954c936726c9315f0ad7c9fc
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Mar 17 09:26:03 2014 -0400

    kerberos: refactor register_error_domain
    
    This commit move type class freeing to the
    otherside of the "out" label to make the code
    robust against potential future changes.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=726353

 src/goaidentity/goaidentityutils.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/src/goaidentity/goaidentityutils.c b/src/goaidentity/goaidentityutils.c
index 6350820..159b1d9 100644
--- a/src/goaidentity/goaidentityutils.c
+++ b/src/goaidentity/goaidentityutils.c
@@ -178,7 +178,7 @@ goa_identity_utils_register_error_domain (GQuark error_domain,
   const char *error_domain_string;
   char *type_name = NULL;
   GType type;
-  GTypeClass *type_class;
+  GTypeClass *type_class = NULL;
   GEnumClass *enum_class;
   guint i;
 
@@ -211,8 +211,7 @@ goa_identity_utils_register_error_domain (GQuark error_domain,
       g_free (dbus_error_string);
     }
 
-  g_type_class_unref (type_class);
-
  out:
+  g_clear_pointer (&type_class, g_type_class_unref);
   g_free (type_name);
 }


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