From b9d1bc83c53454f71990e8550b691f32e352aab0 Mon Sep 17 00:00:00 2001 From: Zhanna Tsitkov Date: Tue, 9 Dec 2008 16:09:18 +0000 Subject: [PATCH] Release default credentials before exiting krb5_gss_init_sec_context routine Ticket: 6294 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21298 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/gssapi/krb5/init_sec_context.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/gssapi/krb5/init_sec_context.c b/src/lib/gssapi/krb5/init_sec_context.c index 40bc0bcbd..aee355d77 100644 --- a/src/lib/gssapi/krb5/init_sec_context.c +++ b/src/lib/gssapi/krb5/init_sec_context.c @@ -1,6 +1,6 @@ /* -*- mode: c; indent-tabs-mode: nil -*- */ /* - * Copyright 2000,2002, 2003, 2007 by the Massachusetts Institute of Technology. + * Copyright 2000,2002, 2003, 2007, 2008 by the Massachusetts Institute of Technology. * All Rights Reserved. * * Export of this software from the United States of America may @@ -902,6 +902,8 @@ krb5_gss_init_sec_context(minor_status, claimant_cred_handle, } kerr = k5_mutex_lock(&cred->lock); if (kerr) { + if (claimant_cred_handle == GSS_C_NO_CREDENTIAL) + krb5_gss_release_cred(minor_status, (gss_cred_id_t *)&cred); krb5_free_context(context); *minor_status = kerr; return GSS_S_FAILURE; -- 2.26.2