if (!(tempto = (krb5_enc_tkt_part *)malloc(sizeof(*tempto))))
return ENOMEM;
*tempto = *partfrom;
- if (retval = krb5_copy_keyblock(partfrom->session,
- &tempto->session)) {
+ retval = krb5_copy_keyblock(partfrom->session,
+ &tempto->session);
+ if (retval) {
xfree(tempto);
return retval;
}
- if (retval = krb5_copy_principal(partfrom->client, &tempto->client)) {
+ retval = krb5_copy_principal(partfrom->client, &tempto->client);
+ if (retval) {
krb5_free_keyblock(tempto->session);
xfree(tempto);
return retval;
partfrom->transited.tr_contents.length);
}
- if (retval = krb5_copy_addresses(partfrom->caddrs, &tempto->caddrs)) {
+ retval = krb5_copy_addresses(partfrom->caddrs, &tempto->caddrs);
+ if (retval) {
xfree(tempto->transited.tr_contents.data);
krb5_free_principal(tempto->client);
krb5_free_keyblock(tempto->session);
return retval;
}
if (partfrom->authorization_data) {
- if (retval = krb5_copy_authdata(partfrom->authorization_data,
- &tempto->authorization_data)) {
+ retval = krb5_copy_authdata(partfrom->authorization_data,
+ &tempto->authorization_data);
+ if (retval) {
krb5_free_addresses(tempto->caddrs);
xfree(tempto->transited.tr_contents.data);
krb5_free_principal(tempto->client);
if (!(tempto = (krb5_ticket *)malloc(sizeof(*tempto))))
return ENOMEM;
*tempto = *from;
- if (retval = krb5_copy_principal(from->server, &tempto->server))
+ retval = krb5_copy_principal(from->server, &tempto->server);
+ if (retval)
return retval;
- if (retval = krb5_copy_data(&from->enc_part.ciphertext, &scratch)) {
+ retval = krb5_copy_data(&from->enc_part.ciphertext, &scratch);
+ if (retval) {
krb5_free_principal(tempto->server);
xfree(tempto);
return retval;
}
tempto->enc_part.ciphertext = *scratch;
xfree(scratch);
- if (retval = krb5_copy_enc_tkt_part(from->enc_part2, &tempto->enc_part2)) {
+ retval = krb5_copy_enc_tkt_part(from->enc_part2, &tempto->enc_part2);
+ if (retval) {
xfree(tempto->enc_part.ciphertext.data);
krb5_free_principal(tempto->server);
xfree(tempto);
return(ENOMEM);
/* do any necessary key pre-processing */
- if (retval = krb5_process_key(&eblock, srv_key)) {
+ retval = krb5_process_key(&eblock, srv_key);
+ if (retval) {
free(scratch.data);
return(retval);
}
/* call the encryption routine */
- if (retval = krb5_decrypt((krb5_pointer) ticket->enc_part.ciphertext.data,
- (krb5_pointer) scratch.data,
- scratch.length, &eblock, 0)) {
+ retval = krb5_decrypt((krb5_pointer) ticket->enc_part.ciphertext.data,
+ (krb5_pointer) scratch.data,
+ scratch.length, &eblock, 0);
+ if (retval) {
(void) krb5_finish_key(&eblock);
free(scratch.data);
return retval;
}
#define clean_scratch() {memset(scratch.data, 0, scratch.length); \
free(scratch.data);}
- if (retval = krb5_finish_key(&eblock)) {
+ retval = krb5_finish_key(&eblock);
+ if (retval) {
clean_scratch();
return retval;
}
/* now decode the decrypted stuff */
- if (!(retval = decode_krb5_enc_tkt_part(&scratch, &dec_tkt_part))) {
+ retval = decode_krb5_enc_tkt_part(&scratch, &dec_tkt_part);
+ if (!retval) {
ticket->enc_part2 = dec_tkt_part;
}
clean_scratch();
/* walk the list BACKWARDS until we find a cached
TGT, then move forward obtaining TGTs until we get the last
TGT needed */
- for (next_server = tgs_list; *next_server; next_server++);
+ for (next_server = tgs_list; *next_server;)
+ next_server++;
nservers = next_server - tgs_list;
next_server--;
krb5_free_realm_tree(tgs_list);
goto out;
}
- krb5_free_data(krb5_princ_realm(final_server));
krb5_princ_set_realm(final_server, tmpdata);
tgtq.server = final_server;