Fix a few bugs in r22736. Cherry-picked from Luke's authdata branch
authorGreg Hudson <ghudson@mit.edu>
Mon, 21 Sep 2009 15:53:47 +0000 (15:53 +0000)
committerGreg Hudson <ghudson@mit.edu>
Mon, 21 Sep 2009 15:53:47 +0000 (15:53 +0000)
ticket: 6563

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22780 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/gssapi/mechglue/g_set_context_option.c
src/lib/krb5/krb/s4u_creds.c

index b35b36ad548f8f994850ce628d758088f4ba5ae5..8f3abbc5debc117cb8b1200a7f37529118d8fe4c 100644 (file)
@@ -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;
index 613bbef1f7d9cd669c13b6e1bee66e0f2a762c5f..678a7714ed00d73cb0140a4d8bd286bbe96ef63a 100644 (file)
@@ -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 |