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



commit f7a52051aeaa882e05588b92ae922b4893f34fa8
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Mar 17 09:42:13 2014 -0400

    kerberos: fix principal leak in identity_renew
    
    The code carefully freed the principal in all error cases, but then
    failed to free the principal in the non-error case!
    
    https://bugzilla.gnome.org/show_bug.cgi?id=726353

 src/goaidentity/goakerberosidentity.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/goaidentity/goakerberosidentity.c b/src/goaidentity/goakerberosidentity.c
index 0bfa430..e1e3ff5 100644
--- a/src/goaidentity/goakerberosidentity.c
+++ b/src/goaidentity/goakerberosidentity.c
@@ -1403,6 +1403,9 @@ goa_kerberos_identity_renew (GoaKerberosIdentity *self, GError **error)
 
   g_debug ("GoaKerberosIdentity: identity %s renewed", name);
   renewed = TRUE;
+
+  krb5_free_principal (self->priv->kerberos_context, principal);
+
 out:
   g_free (name);
 


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