[gnome-online-accounts/gnome-3-12] kerberos: fix leak in register_error_domain



commit 8ef43f5c6458922ed7afc7f65117c988037c1f09
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 |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/goaidentity/goaidentityutils.c b/src/goaidentity/goaidentityutils.c
index 82db181..6350820 100644
--- a/src/goaidentity/goaidentityutils.c
+++ b/src/goaidentity/goaidentityutils.c
@@ -176,7 +176,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;
@@ -190,7 +190,7 @@ goa_identity_utils_register_error_domain (GQuark error_domain,
   if (type_class == NULL)
     {
       g_warning ("GoaIdentityUtils: Could not identity type %s", type_name);
-      return;
+      goto out;
     }
 
   enum_class = G_ENUM_CLASS (type_class);
@@ -212,4 +212,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]