krb5_data *scratch;
krb5_enctype etype;
krb5_encrypt_block eblock;
+ krb5_data *toutbuf;
if ((ap_req_options & AP_OPTS_USE_SESSION_KEY) &&
!creds->ticket.length)
}
/* encode it before encrypting */
retval = encode_krb5_authenticator(&authent, &scratch);
- cleanup_ticket();
- if (retval)
+ if (retval) {
+ cleanup_ticket();
return(retval);
+ }
#define cleanup_scratch() { (void) bzero(scratch->data, scratch->length); krb5_free_data(scratch); }
return retval;
}
- retval = encode_krb5_ap_req(&request, &outbuf);
+ if (!(retval = encode_krb5_ap_req(&request, &toutbuf))) {
+ *outbuf = *toutbuf;
+ xfree(toutbuf);
+ }
+ cleanup_ticket();
cleanup_encpart();
- if (retval)
- return(retval);
+ return retval;
clean_prockey:
cleanup_prockey();