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,9 +146,18 @@ 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);
if (auth->cksum == NULL) {
ret = ENOMEM;
goto fail;
}
ret = copy_Checksum(cksum, auth->cksum);
if (ret)
goto fail;
if (auth->cksum->cksumtype == CKSUMTYPE_GSSAPI) {
/* /*
* This is not GSS-API specific, we only enable it for * This is not GSS-API specific, we only enable it for
* GSS for now * GSS for now
@@ -157,6 +166,7 @@ krb5_build_authenticator (krb5_context context,
if (ret) if (ret)
goto fail; 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);
} }