From: Greg Hudson Date: Mon, 21 Sep 2009 15:53:47 +0000 (+0000) Subject: Fix a few bugs in r22736. Cherry-picked from Luke's authdata branch X-Git-Tag: krb5-1.8-alpha1~343 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=aa53ac48167aeb7d355284aa59541802d3980795;p=krb5.git Fix a few bugs in r22736. Cherry-picked from Luke's authdata branch ticket: 6563 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22780 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/gssapi/mechglue/g_set_context_option.c b/src/lib/gssapi/mechglue/g_set_context_option.c index b35b36ad5..8f3abbc5d 100644 --- a/src/lib/gssapi/mechglue/g_set_context_option.c +++ b/src/lib/gssapi/mechglue/g_set_context_option.c @@ -81,7 +81,7 @@ gss_set_sec_context_option (OM_uint32 *minor_status, if (ctx == NULL) { *minor_status = ENOMEM; gssint_delete_internal_sec_context(&minor, - ctx->mech_type, + &mech->mech_type, &internal_ctx, GSS_C_NO_BUFFER); return GSS_S_FAILURE; diff --git a/src/lib/krb5/krb/s4u_creds.c b/src/lib/krb5/krb/s4u_creds.c index 613bbef1f..678a7714e 100644 --- a/src/lib/krb5/krb/s4u_creds.c +++ b/src/lib/krb5/krb/s4u_creds.c @@ -207,10 +207,8 @@ build_pa_for_user(krb5_context context, krb5_data *for_user_data = NULL; char package[] = "Kerberos"; - if (userid->user == NULL) { - code = EINVAL; - goto cleanup; - } + if (userid->user == NULL) + return EINVAL; memset(&for_user, 0, sizeof(for_user)); for_user.user = userid->user; @@ -580,8 +578,10 @@ krb5_get_self_cred_from_kdc(krb5_context context, code = krb5int_copy_data_contents(context, &tgtptr->server->data[1], &s4u_creds.server->realm); - if (code != 0) + if (code != 0) { + krb5_free_pa_data(context, in_padata); goto cleanup; + } code = krb5_get_cred_via_tkt_ext(context, tgtptr, KDC_OPT_CANONICALIZE |