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



commit 16ed9d42df911c81d39151fb6befd1a166fee974
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 4fcc881..900ffe3 100644
--- a/src/goaidentity/goakerberosidentity.c
+++ b/src/goaidentity/goakerberosidentity.c
@@ -632,6 +632,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]