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



commit c32e42f2bd2f97176f1fdfb2f506cefed1f0116b
Author: Michael Cronenworth <mike cchtml com>
Date:   Mon Mar 17 09:47:01 2014 -0400

    kerberos: fix leak in verify_identity
    
    The kerberos API allocates credentials on the heap, when iterating
    over a credential collection (for each iteration).
    
    This commit makes sure each of those credentials is freed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=726353

 src/goaidentity/goakerberosidentity.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/goaidentity/goakerberosidentity.c b/src/goaidentity/goakerberosidentity.c
index 00d3b83..e3e7664 100644
--- a/src/goaidentity/goakerberosidentity.c
+++ b/src/goaidentity/goakerberosidentity.c
@@ -635,6 +635,8 @@ verify_identity (GoaKerberosIdentity  *self,
             verification_level = VERIFICATION_LEVEL_EXISTS;
         }
 
+      krb5_free_cred_contents (self->priv->kerberos_context, &credentials);
+
       error_code = krb5_cc_next_cred (self->priv->kerberos_context,
                                       self->priv->credentials_cache,
                                       &cursor,


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