[gnome-online-accounts/gnome-3-10] kerberos: refactor register_error_domain
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-online-accounts/gnome-3-10] kerberos: refactor register_error_domain
- Date: Mon, 17 Mar 2014 15:05:47 +0000 (UTC)
commit abaa3f05528d5ebd039576057c123980cf47c451
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 64c6b82..68ec3c6 100644
--- a/src/goaidentity/goaidentityutils.c
+++ b/src/goaidentity/goaidentityutils.c
@@ -181,7 +181,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;
@@ -214,8 +214,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]