From: John Kohl Date: Tue, 8 May 1990 15:53:24 +0000 (+0000) Subject: various minor fixes to make it work X-Git-Tag: krb5-1.0-alpha2~622 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7784338dd173e5c382f27d8382226ead2de3c140;p=krb5.git various minor fixes to make it work git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@783 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/krb/copy_tick.c b/src/lib/krb5/krb/copy_tick.c index 437b65419..5078a3c89 100644 --- a/src/lib/krb5/krb/copy_tick.c +++ b/src/lib/krb5/krb/copy_tick.c @@ -30,7 +30,7 @@ krb5_enc_tkt_part **partto; krb5_enc_tkt_part *tempto; krb5_data *scratch; - if (!(tempto = (krb5_ticket *)malloc(sizeof(*tempto)))) + if (!(tempto = (krb5_enc_tkt_part *)malloc(sizeof(*tempto)))) return ENOMEM; *tempto = *partfrom; if (!(tempto->session = @@ -39,7 +39,7 @@ krb5_enc_tkt_part **partto; return ENOMEM; } if (retval = krb5_copy_keyblock(partfrom->session, - &tempto->session)) { + tempto->session)) { xfree(tempto->session); xfree(tempto); return retval; @@ -64,22 +64,23 @@ krb5_enc_tkt_part **partto; xfree(tempto); return retval; } - if (retval = krb5_copy_authdata(partfrom->authorization_data, - &tempto->authorization_data)) { - krb5_free_address(tempto->caddrs); - xfree(tempto->transited.data); - krb5_free_principal(tempto->client); - krb5_free_keyblock(tempto->session); - xfree(tempto); - return retval; + if (partfrom->authorization_data) { + if (retval = krb5_copy_authdata(partfrom->authorization_data, + &tempto->authorization_data)) { + krb5_free_address(tempto->caddrs); + xfree(tempto->transited.data); + krb5_free_principal(tempto->client); + krb5_free_keyblock(tempto->session); + xfree(tempto); + return retval; + } } - *partto = tempto; return 0; } krb5_error_code -copy_ticket(from, pto) +krb5_copy_ticket(from, pto) const krb5_ticket *from; krb5_ticket **pto; { @@ -92,14 +93,14 @@ krb5_ticket **pto; *tempto = *from; if (retval = krb5_copy_principal(from->server, &tempto->server)) return retval; - if (retval = krb5_copy_data(from->enc_part, &scratch)) { + if (retval = krb5_copy_data(&from->enc_part, &scratch)) { krb5_free_principal(tempto->server); xfree(tempto); return retval; } tempto->enc_part = *scratch; xfree(scratch); - if (retval = krb5_copy_enc_tkt_part(from->enc_part2, &to->enc_part2)) { + if (retval = krb5_copy_enc_tkt_part(from->enc_part2, &tempto->enc_part2)) { xfree(tempto->enc_part.data); krb5_free_principal(tempto->server); xfree(tempto);