]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
don't free caller owned memory if krb5_generate_authenticator/encode_krb5_authenticat...
authorLuke Howard <lukeh@padl.com>
Wed, 26 Aug 2009 12:16:19 +0000 (12:16 +0000)
committerLuke Howard <lukeh@padl.com>
Wed, 26 Aug 2009 12:16:19 +0000 (12:16 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/users/lhoward/authdata@22617 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/krb/mk_req_ext.c

index 95049a4fa87450aa5a2c34aa71f5a1166dcec49b..06f1140fc312130a8245a0d4133f8c2c054ce63e 100644 (file)
@@ -255,12 +255,6 @@ krb5_mk_req_extended(krb5_context context, krb5_auth_context *auth_context,
                                            &scratch)))
        goto cleanup_cksum;
     
-    /* Null out these fields, to prevent pointer sharing problems;
-     * they were supplied by the caller
-     */
-    (*auth_context)->authentp->client = NULL;
-    (*auth_context)->authentp->checksum = NULL;
-
     /* call the encryption routine */
     if ((retval = krb5_encrypt_helper(context, &in_creds->keyblock,
                                      KRB5_KEYUSAGE_AP_REQ_AUTH,
@@ -274,6 +268,13 @@ krb5_mk_req_extended(krb5_context context, krb5_auth_context *auth_context,
     free(toutbuf);
 
 cleanup_cksum:
+    /* Null out these fields, to prevent pointer sharing problems;
+     * they were supplied by the caller
+     */
+    if ((*auth_context)->authentp != NULL) {
+       (*auth_context)->authentp->client = NULL;
+       (*auth_context)->authentp->checksum = NULL;
+    }
     if (checksump && checksump->checksum_type != 0x8003)
       free(checksump->contents);