krb5 commit [krb5-1.11]: Clean up rcache if GSS krb5 acquire_cred fails

Tom Yu tlyu at mit.edu
Fri Feb 6 17:26:39 EST 2015


https://github.com/krb5/krb5/commit/08b5facdaa3397126b7502d5b1cd1aff1216c840
commit 08b5facdaa3397126b7502d5b1cd1aff1216c840
Author: Greg Hudson <ghudson at mit.edu>
Date:   Wed Jan 15 14:41:54 2014 -0500

    Clean up rcache if GSS krb5 acquire_cred fails
    
    The error handler in acquire_cred_context didn't release the rcache,
    which would cause it to leak if we failed after acquire_accept_cred.
    
    (cherry picked from commit 9df0c4bdce6b88a01af51e4bbb9a365db00256d5)
    
    ticket: 8077 (new)
    version_fixed: 1.11.6
    status: resolved

 src/lib/gssapi/krb5/acquire_cred.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/lib/gssapi/krb5/acquire_cred.c b/src/lib/gssapi/krb5/acquire_cred.c
index af3928a..2d54171 100644
--- a/src/lib/gssapi/krb5/acquire_cred.c
+++ b/src/lib/gssapi/krb5/acquire_cred.c
@@ -831,6 +831,8 @@ error_out:
         if (cred->keytab)
             krb5_kt_close(context, cred->keytab);
 #endif /* LEAN_CLIENT */
+        if (cred->rcache)
+            krb5_rc_close(context, cred->rcache);
         if (cred->name)
             kg_release_name(context, &cred->name);
         k5_mutex_destroy(&cred->lock);


More information about the cvs-krb5 mailing list