[gnome-online-accounts] kerberos: fix leak in register_error_domain
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-online-accounts] kerberos: fix leak in register_error_domain
- Date: Mon, 17 Mar 2014 14:05:00 +0000 (UTC)
commit c679b882beca20c6801a922d08514156d0dd95f9
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]