[gnome-online-accounts/rhel-7.1: 1/34] kerberos: fix leak in register_error_domain



commit b600cb24544055ed4843c564d4ee12d80b7bd2db
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Mar 17 09:20:49 2014 -0400

    kerberos: fix leak in register_error_domain
    
    In the event a type was not known, we were leaking the
    type name.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=726353

 src/goaidentity/goaidentityutils.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/goaidentity/goaidentityutils.c b/src/goaidentity/goaidentityutils.c
index 2730664..064c3f6 100644
--- a/src/goaidentity/goaidentityutils.c
+++ b/src/goaidentity/goaidentityutils.c
@@ -179,7 +179,7 @@ goa_identity_utils_register_error_domain (GQuark error_domain,
                                           GType  error_enum)
 {
   const char *error_domain_string;
-  char *type_name;
+  char *type_name = NULL;
   GType type;
   GTypeClass *type_class;
   GEnumClass *enum_class;
@@ -192,8 +192,8 @@ goa_identity_utils_register_error_domain (GQuark error_domain,
 
   if (type_class == NULL)
     {
-      goa_warning ("GoaIdentityUtils: Could not identity type %s", type_name);
-      return;
+      g_warning ("GoaIdentityUtils: Could not identity type %s", type_name);
+      goto out;
     }
 
   enum_class = G_ENUM_CLASS (type_class);
@@ -215,4 +215,7 @@ goa_identity_utils_register_error_domain (GQuark error_domain,
     }
 
   g_type_class_unref (type_class);
+
+ out:
+  g_free (type_name);
 }


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