From: Zhanna Tsitkov Date: Tue, 9 Dec 2008 16:09:18 +0000 (+0000) Subject: Release default credentials before exiting krb5_gss_init_sec_context routine X-Git-Tag: krb5-1.7-alpha1~173 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b9d1bc83c53454f71990e8550b691f32e352aab0;p=krb5.git 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 --- 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;