From: Luke Howard Date: Wed, 26 Aug 2009 12:16:19 +0000 (+0000) Subject: don't free caller owned memory if krb5_generate_authenticator/encode_krb5_authenticat... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=af2dbc80bd4aa6109dd1112db495ec1034d005c7;p=thirdparty%2Fkrb5.git don't free caller owned memory if krb5_generate_authenticator/encode_krb5_authenticator fails git-svn-id: svn://anonsvn.mit.edu/krb5/users/lhoward/authdata@22617 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/krb/mk_req_ext.c b/src/lib/krb5/krb/mk_req_ext.c index 95049a4fa8..06f1140fc3 100644 --- a/src/lib/krb5/krb/mk_req_ext.c +++ b/src/lib/krb5/krb/mk_req_ext.c @@ -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);