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



commit 379b8c96237bfb89436b3f341944ac4661cc8f73
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
    
    Conflicts:
        src/goaidentity/goaidentityutils.c

 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 617c133..64c6b82 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;
@@ -193,7 +193,7 @@ goa_identity_utils_register_error_domain (GQuark error_domain,
   if (type_class == NULL)
     {
       goa_warning ("GoaIdentityUtils: Could not identity type %s", type_name);
-      return;
+      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]