Just make a copy of the cksum instead of trying to work around the

fact that its not really copied.
This commit is contained in:
Love Hornquist Astrand
2009-10-05 19:25:46 -07:00
parent 753e2cc925
commit cc65dc4e8e

View File

@@ -146,16 +146,26 @@ krb5_build_authenticator (krb5_context context,
} else } else
auth->seq_number = NULL; auth->seq_number = NULL;
auth->authorization_data = NULL; auth->authorization_data = NULL;
auth->cksum = cksum;
if (cksum != NULL && cksum->cksumtype == CKSUMTYPE_GSSAPI) { if (cksum) {
/* ALLOC(auth->cksum, 1);
* This is not GSS-API specific, we only enable it for if (auth->cksum == NULL) {
* GSS for now ret = ENOMEM;
*/ goto fail;
ret = make_etypelist(context, &auth->authorization_data); }
ret = copy_Checksum(cksum, auth->cksum);
if (ret) if (ret)
goto fail; goto fail;
if (auth->cksum->cksumtype == CKSUMTYPE_GSSAPI) {
/*
* This is not GSS-API specific, we only enable it for
* GSS for now
*/
ret = make_etypelist(context, &auth->authorization_data);
if (ret)
goto fail;
}
} }
/* XXX - Copy more to auth_context? */ /* XXX - Copy more to auth_context? */
@@ -189,7 +199,6 @@ krb5_build_authenticator (krb5_context context,
*auth_result = auth; *auth_result = auth;
else { else {
/* Don't free the `cksum', it's allocated by the caller */ /* Don't free the `cksum', it's allocated by the caller */
auth->cksum = NULL;
free_Authenticator (auth); free_Authenticator (auth);
free (auth); free (auth);
} }