From 11489bbc8648b59a12147c285a435eefaf88f4ea Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Wed, 1 Dec 1993 20:49:51 +0000 Subject: [PATCH] GCC wants the "register" keyword to be first (before the "const" keyword) Fixed a number of memory leaks. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@3051 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/asn.1/aprp2kaprp.c | 2 +- src/lib/krb5/asn.1/aprq2kaprq.c | 2 +- src/lib/krb5/asn.1/arep2karep.c | 2 +- src/lib/krb5/asn.1/auth2kauth.c | 2 +- src/lib/krb5/asn.1/ck2kck.c | 2 +- src/lib/krb5/asn.1/cred2kcred.c | 2 +- src/lib/krb5/asn.1/crep2kcrep.c | 25 +++++++++++++++---------- src/lib/krb5/asn.1/edat2kedat.c | 2 +- src/lib/krb5/asn.1/ekrp2kekrp.c | 2 +- src/lib/krb5/asn.1/enck2kkey.c | 2 +- src/lib/krb5/asn.1/err2kerr.c | 2 +- src/lib/krb5/asn.1/etpt2ketpt.c | 2 +- src/lib/krb5/asn.1/kaprp2aprp.c | 2 +- src/lib/krb5/asn.1/kaprq2aprq.c | 2 +- src/lib/krb5/asn.1/karep2arep.c | 2 +- src/lib/krb5/asn.1/kauth2auth.c | 2 +- src/lib/krb5/asn.1/kcred2cred.c | 2 +- src/lib/krb5/asn.1/kcrep2crep.c | 2 +- src/lib/krb5/asn.1/kdcr2kkdcr.c | 7 ++++--- src/lib/krb5/asn.1/kdcr2ktgsr.c | 2 +- src/lib/krb5/asn.1/kedat2edat.c | 2 +- src/lib/krb5/asn.1/kekrp2ekrp.c | 2 +- src/lib/krb5/asn.1/kerr2err.c | 2 +- src/lib/krb5/asn.1/ketpt2etpt.c | 2 +- src/lib/krb5/asn.1/kkdcr2kdcr.c | 4 ++-- src/lib/krb5/asn.1/kprep2prep.c | 2 +- src/lib/krb5/asn.1/kpriv2priv.c | 2 +- src/lib/krb5/asn.1/kpwd2pwd.c | 2 +- src/lib/krb5/asn.1/ksafe2safe.c | 2 +- src/lib/krb5/asn.1/ktgrq2tgrq.c | 4 ++-- src/lib/krb5/asn.1/ktgsr2kdcr.c | 2 +- src/lib/krb5/asn.1/ktkt2tkt.c | 2 +- src/lib/krb5/asn.1/ktran2tran.c | 2 +- src/lib/krb5/asn.1/prep2kprep.c | 2 +- src/lib/krb5/asn.1/prin2kprin.c | 5 ++++- src/lib/krb5/asn.1/priv2kpriv.c | 2 +- src/lib/krb5/asn.1/pwd2kpwd.c | 2 +- src/lib/krb5/asn.1/pwds2kpwds.c | 2 +- src/lib/krb5/asn.1/safe2ksafe.c | 2 +- src/lib/krb5/asn.1/tgrq2ktgrq.c | 4 ++-- src/lib/krb5/asn.1/tkt2ktkt.c | 2 +- src/lib/krb5/asn.1/tran2ktran.c | 2 +- 42 files changed, 65 insertions(+), 56 deletions(-) diff --git a/src/lib/krb5/asn.1/aprp2kaprp.c b/src/lib/krb5/asn.1/aprp2kaprp.c index 49bc5b297..a77c1edf8 100644 --- a/src/lib/krb5/asn.1/aprp2kaprp.c +++ b/src/lib/krb5/asn.1/aprp2kaprp.c @@ -43,7 +43,7 @@ static char rcsid_aprp2kaprp_c[] = krb5_ap_rep * KRB5_AP__REP2krb5_ap_rep(val, error) -const register struct type_KRB5_AP__REP *val; +register const struct type_KRB5_AP__REP *val; register int *error; { register krb5_ap_rep *retval; diff --git a/src/lib/krb5/asn.1/aprq2kaprq.c b/src/lib/krb5/asn.1/aprq2kaprq.c index 7c587723c..c67c01b4d 100644 --- a/src/lib/krb5/asn.1/aprq2kaprq.c +++ b/src/lib/krb5/asn.1/aprq2kaprq.c @@ -43,7 +43,7 @@ static char rcsid_aprq2kaprq_c[] = krb5_ap_req * KRB5_AP__REQ2krb5_ap_req(val, error) -const register struct type_KRB5_AP__REQ *val; +register const struct type_KRB5_AP__REQ *val; register int *error; { register krb5_ap_req *retval; diff --git a/src/lib/krb5/asn.1/arep2karep.c b/src/lib/krb5/asn.1/arep2karep.c index 25a4cfd87..a123a55e9 100644 --- a/src/lib/krb5/asn.1/arep2karep.c +++ b/src/lib/krb5/asn.1/arep2karep.c @@ -43,7 +43,7 @@ static char rcsid_arep2karep_c[] = krb5_ap_rep_enc_part * KRB5_EncAPRepPart2krb5_ap_rep_enc_part(val, error) -const register struct type_KRB5_EncAPRepPart *val; +register const struct type_KRB5_EncAPRepPart *val; register int *error; { register krb5_ap_rep_enc_part *retval; diff --git a/src/lib/krb5/asn.1/auth2kauth.c b/src/lib/krb5/asn.1/auth2kauth.c index 91fa9a2a8..66d00a446 100644 --- a/src/lib/krb5/asn.1/auth2kauth.c +++ b/src/lib/krb5/asn.1/auth2kauth.c @@ -43,7 +43,7 @@ static char rcsid_auth2kauth_c[] = krb5_authenticator * KRB5_Authenticator2krb5_authenticator(val, error) -const register struct type_KRB5_Authenticator *val; +register const struct type_KRB5_Authenticator *val; register int *error; { register krb5_authenticator *retval; diff --git a/src/lib/krb5/asn.1/ck2kck.c b/src/lib/krb5/asn.1/ck2kck.c index f68927e28..fc4c725ab 100644 --- a/src/lib/krb5/asn.1/ck2kck.c +++ b/src/lib/krb5/asn.1/ck2kck.c @@ -43,7 +43,7 @@ static char rcsid_ck2kck_c[] = krb5_checksum * KRB5_Checksum2krb5_checksum(val, error) -const register struct type_KRB5_Checksum *val; +register const struct type_KRB5_Checksum *val; register int *error; { krb5_checksum *retval; diff --git a/src/lib/krb5/asn.1/cred2kcred.c b/src/lib/krb5/asn.1/cred2kcred.c index 2cd082a6d..793ce784f 100644 --- a/src/lib/krb5/asn.1/cred2kcred.c +++ b/src/lib/krb5/asn.1/cred2kcred.c @@ -43,7 +43,7 @@ static char rcsid_cred2kcred_c[] = krb5_cred * KRB5_KRB__CRED2krb5_cred(val, error) -const register struct type_KRB5_KRB__CRED *val; +register const struct type_KRB5_KRB__CRED *val; register int *error; { register krb5_cred *retval; diff --git a/src/lib/krb5/asn.1/crep2kcrep.c b/src/lib/krb5/asn.1/crep2kcrep.c index 11cae366d..61e79772e 100644 --- a/src/lib/krb5/asn.1/crep2kcrep.c +++ b/src/lib/krb5/asn.1/crep2kcrep.c @@ -43,7 +43,7 @@ static char rcsid_crep2kcrep_c[] = krb5_cred_enc_part * KRB5_EncKrbCredPart2krb5_cred_enc_part(val, error) -const register struct type_KRB5_EncKrbCredPart *val; +register const struct type_KRB5_EncKrbCredPart *val; register int *error; { register krb5_cred_enc_part *retval; @@ -64,8 +64,8 @@ register int *error; retval->ticket_info = (krb5_cred_info **) xcalloc(i + 1, sizeof(*retval->ticket_info)); if (!retval->ticket_info) { - nomem: *error = ENOMEM; + krb5_xfree(retval); return(0); } @@ -75,19 +75,24 @@ register int *error; retval->nonce = 0; if (val->timestamp) { + if (!(val->optionals & opt_KRB5_EncKrbPrivPart_usec)) { + /* must have usec if we have timestamp */ + *error = ISODE_50_LOCAL_ERR_BADCOMBO; + goto errout; + } + retval->timestamp = gentime2unix(val->timestamp, error); if (*error) { errout: krb5_free_cred_enc_part(retval); return(0); } + retval->usec = val->usec; + } else { + retval->timestamp = 0; + retval->usec = 0; } - - if (val->optionals & opt_KRB5_EncKrbCredPart_usec) - retval->usec = val->usec; - else - retval->timestamp = 0; - + if (val->s__address) { retval->s_address = KRB5_HostAddress2krb5_addr(val->s__address, @@ -110,8 +115,8 @@ register int *error; retval->ticket_info[i] = (krb5_cred_info *) xmalloc(sizeof(*retval->ticket_info[i])); if (!retval->ticket_info[i]) { - krb5_free_cred_enc_part(retval); - goto nomem; + *error = ENOMEM; + goto errout; } xbzero((char *)retval->ticket_info[i], sizeof(*retval->ticket_info[i])); diff --git a/src/lib/krb5/asn.1/edat2kedat.c b/src/lib/krb5/asn.1/edat2kedat.c index da0a4b955..4e3f99cff 100644 --- a/src/lib/krb5/asn.1/edat2kedat.c +++ b/src/lib/krb5/asn.1/edat2kedat.c @@ -43,7 +43,7 @@ static char rcsid_edat2kedat_c[] = krb5_enc_data * KRB5_EncryptedData2krb5_enc_data(val, error) -const register struct type_KRB5_EncryptedData *val; +register const struct type_KRB5_EncryptedData *val; register int *error; { register krb5_enc_data *retval; diff --git a/src/lib/krb5/asn.1/ekrp2kekrp.c b/src/lib/krb5/asn.1/ekrp2kekrp.c index 7a53badf7..e161916b3 100644 --- a/src/lib/krb5/asn.1/ekrp2kekrp.c +++ b/src/lib/krb5/asn.1/ekrp2kekrp.c @@ -43,7 +43,7 @@ static char rcsid_ekrp2kekrp_c[] = krb5_enc_kdc_rep_part * KRB5_EncKDCRepPart2krb5_enc_kdc_rep_part(val, error) -const register struct type_KRB5_EncKDCRepPart *val; +register const struct type_KRB5_EncKDCRepPart *val; register int *error; { register krb5_enc_kdc_rep_part *retval; diff --git a/src/lib/krb5/asn.1/enck2kkey.c b/src/lib/krb5/asn.1/enck2kkey.c index 4db62735b..9ad82e456 100644 --- a/src/lib/krb5/asn.1/enck2kkey.c +++ b/src/lib/krb5/asn.1/enck2kkey.c @@ -44,7 +44,7 @@ static char rcsid_enck2kkey_c[] = krb5_keyblock * KRB5_EncryptionKey2krb5_keyblock(val, error) -const register struct type_KRB5_EncryptionKey *val; +register const struct type_KRB5_EncryptionKey *val; register int *error; { krb5_keyblock *retval; diff --git a/src/lib/krb5/asn.1/err2kerr.c b/src/lib/krb5/asn.1/err2kerr.c index 4dd918cd8..49a279ff1 100644 --- a/src/lib/krb5/asn.1/err2kerr.c +++ b/src/lib/krb5/asn.1/err2kerr.c @@ -43,7 +43,7 @@ static char rcsid_err2kerr_c[] = krb5_error * KRB5_KRB__ERROR2krb5_error(val, error) -const register struct type_KRB5_KRB__ERROR *val; +register const struct type_KRB5_KRB__ERROR *val; register int *error; { register krb5_error *retval; diff --git a/src/lib/krb5/asn.1/etpt2ketpt.c b/src/lib/krb5/asn.1/etpt2ketpt.c index a78aef4e7..de85d394e 100644 --- a/src/lib/krb5/asn.1/etpt2ketpt.c +++ b/src/lib/krb5/asn.1/etpt2ketpt.c @@ -43,7 +43,7 @@ static char rcsid_etpt2ketpt_c[] = krb5_enc_tkt_part * KRB5_EncTicketPart2krb5_enc_tkt_part(val, error) -const register struct type_KRB5_EncTicketPart *val; +register const struct type_KRB5_EncTicketPart *val; register int *error; { register krb5_enc_tkt_part *retval; diff --git a/src/lib/krb5/asn.1/kaprp2aprp.c b/src/lib/krb5/asn.1/kaprp2aprp.c index b71cd93b5..f4c7a96dc 100644 --- a/src/lib/krb5/asn.1/kaprp2aprp.c +++ b/src/lib/krb5/asn.1/kaprp2aprp.c @@ -43,7 +43,7 @@ static char rcsid_kaprp2aprp_c[] = struct type_KRB5_AP__REP * krb5_ap_rep2KRB5_AP__REP(val, error) -const register krb5_ap_rep *val; +register const krb5_ap_rep *val; register int *error; { register struct type_KRB5_AP__REP *retval; diff --git a/src/lib/krb5/asn.1/kaprq2aprq.c b/src/lib/krb5/asn.1/kaprq2aprq.c index 86e0c6e27..e3d0b3ef0 100644 --- a/src/lib/krb5/asn.1/kaprq2aprq.c +++ b/src/lib/krb5/asn.1/kaprq2aprq.c @@ -43,7 +43,7 @@ static char rcsid_kaprq2aprq_c[] = struct type_KRB5_AP__REQ * krb5_ap_req2KRB5_AP__REQ(val, error) -const register krb5_ap_req *val; +register const krb5_ap_req *val; register int *error; { register struct type_KRB5_AP__REQ *retval; diff --git a/src/lib/krb5/asn.1/karep2arep.c b/src/lib/krb5/asn.1/karep2arep.c index 146346fed..bd8d69d60 100644 --- a/src/lib/krb5/asn.1/karep2arep.c +++ b/src/lib/krb5/asn.1/karep2arep.c @@ -43,7 +43,7 @@ static char rcsid_karep2arep_c[] = struct type_KRB5_EncAPRepPart * krb5_ap_rep_enc_part2KRB5_EncAPRepPart(val, error) -const register krb5_ap_rep_enc_part *val; +register const krb5_ap_rep_enc_part *val; register int *error; { register struct type_KRB5_EncAPRepPart *retval; diff --git a/src/lib/krb5/asn.1/kauth2auth.c b/src/lib/krb5/asn.1/kauth2auth.c index c3e94dc2f..77da94179 100644 --- a/src/lib/krb5/asn.1/kauth2auth.c +++ b/src/lib/krb5/asn.1/kauth2auth.c @@ -43,7 +43,7 @@ static char rcsid_kauth2auth_c[] = struct type_KRB5_Authenticator * krb5_authenticator2KRB5_Authenticator(val, error) -const register krb5_authenticator *val; +register const krb5_authenticator *val; register int *error; { register struct type_KRB5_Authenticator *retval; diff --git a/src/lib/krb5/asn.1/kcred2cred.c b/src/lib/krb5/asn.1/kcred2cred.c index 2e6cf7639..c796b5361 100644 --- a/src/lib/krb5/asn.1/kcred2cred.c +++ b/src/lib/krb5/asn.1/kcred2cred.c @@ -44,7 +44,7 @@ static char rcsid_kcred2cred_c[] = struct type_KRB5_KRB__CRED * krb5_cred2KRB5_KRB__CRED(val, error) -const register krb5_cred *val; +register const krb5_cred *val; register int *error; { register struct type_KRB5_KRB__CRED *retval; diff --git a/src/lib/krb5/asn.1/kcrep2crep.c b/src/lib/krb5/asn.1/kcrep2crep.c index 3c48216a0..a7f6883aa 100644 --- a/src/lib/krb5/asn.1/kcrep2crep.c +++ b/src/lib/krb5/asn.1/kcrep2crep.c @@ -43,7 +43,7 @@ static char rcsid_kcrep2crep_c[] = struct type_KRB5_EncKrbCredPart * krb5_cred_enc_part2KRB5_EncKrbCredPart(val, error) -const register krb5_cred_enc_part *val; +register const krb5_cred_enc_part *val; register int *error; { struct type_KRB5_EncKrbCredPart *retval = 0; diff --git a/src/lib/krb5/asn.1/kdcr2kkdcr.c b/src/lib/krb5/asn.1/kdcr2kkdcr.c index a60ccfe31..01ee74759 100644 --- a/src/lib/krb5/asn.1/kdcr2kkdcr.c +++ b/src/lib/krb5/asn.1/kdcr2kkdcr.c @@ -62,7 +62,8 @@ element_KRB5_112krb5_pa_data(val, error) } for (i = 0, rv = val; rv; rv = rv->next, i++) { if (qb_pullup(rv->PA__DATA->pa__data) != OK) { - krb5_xfree(retval); + retval[i] = 0; + krb5_free_pa_data(retval); *error = ENOMEM; return(0); } @@ -95,7 +96,7 @@ element_KRB5_112krb5_pa_data(val, error) krb5_kdc_rep * KRB5_KDC__REP2krb5_kdc_rep(val, error) -const register struct type_KRB5_TGS__REP *val; +register const struct type_KRB5_TGS__REP *val; register int *error; { register krb5_kdc_rep *retval; @@ -122,7 +123,7 @@ register int *error; val->crealm, error); if (!retval->client) { - krb5_xfree(retval); + krb5_free_kdc_rep(retval); return(0); } diff --git a/src/lib/krb5/asn.1/kdcr2ktgsr.c b/src/lib/krb5/asn.1/kdcr2ktgsr.c index d034ec001..a3352044b 100644 --- a/src/lib/krb5/asn.1/kdcr2ktgsr.c +++ b/src/lib/krb5/asn.1/kdcr2ktgsr.c @@ -43,7 +43,7 @@ static char rcsid_kdcr2ktgsr_c[] = krb5_kdc_rep * KRB5_KDC__REP2krb5_tgs_rep(val, error) -const register struct type_KRB5_TGS__REP *val; +register const struct type_KRB5_TGS__REP *val; register int *error; { return KRB5_KDC__REP2krb5_kdc_rep(val, error); diff --git a/src/lib/krb5/asn.1/kedat2edat.c b/src/lib/krb5/asn.1/kedat2edat.c index f66918feb..6df7d2cc9 100644 --- a/src/lib/krb5/asn.1/kedat2edat.c +++ b/src/lib/krb5/asn.1/kedat2edat.c @@ -43,7 +43,7 @@ static char rcsid_kedat2edat_c[] = struct type_KRB5_EncryptedData * krb5_enc_data2KRB5_EncryptedData(val, error) -const register krb5_enc_data *val; +register const krb5_enc_data *val; register int *error; { register struct type_KRB5_EncryptedData *retval; diff --git a/src/lib/krb5/asn.1/kekrp2ekrp.c b/src/lib/krb5/asn.1/kekrp2ekrp.c index ee53e3479..ecf814d45 100644 --- a/src/lib/krb5/asn.1/kekrp2ekrp.c +++ b/src/lib/krb5/asn.1/kekrp2ekrp.c @@ -43,7 +43,7 @@ static char rcsid_kekrp2ekrp_c[] = struct type_KRB5_EncKDCRepPart * krb5_enc_kdc_rep_part2KRB5_EncKDCRepPart(val, error) -const register krb5_enc_kdc_rep_part *val; +register const krb5_enc_kdc_rep_part *val; register int *error; { register struct type_KRB5_EncKDCRepPart *retval; diff --git a/src/lib/krb5/asn.1/kerr2err.c b/src/lib/krb5/asn.1/kerr2err.c index 102f7e297..5f3513d80 100644 --- a/src/lib/krb5/asn.1/kerr2err.c +++ b/src/lib/krb5/asn.1/kerr2err.c @@ -43,7 +43,7 @@ static char rcsid_kerr2err_c[] = struct type_KRB5_KRB__ERROR * krb5_error2KRB5_KRB__ERROR(val, error) -const register krb5_error *val; +register const krb5_error *val; register int *error; { register struct type_KRB5_KRB__ERROR *retval; diff --git a/src/lib/krb5/asn.1/ketpt2etpt.c b/src/lib/krb5/asn.1/ketpt2etpt.c index 94dc4530d..28e75c097 100644 --- a/src/lib/krb5/asn.1/ketpt2etpt.c +++ b/src/lib/krb5/asn.1/ketpt2etpt.c @@ -39,7 +39,7 @@ static char rcsid_ketpt2etpt_c[] = struct type_KRB5_EncTicketPart * krb5_enc_tkt_part2KRB5_EncTicketPart(val, error) -const register krb5_enc_tkt_part *val; +register const krb5_enc_tkt_part *val; register int *error; { register struct type_KRB5_EncTicketPart *retval; diff --git a/src/lib/krb5/asn.1/kkdcr2kdcr.c b/src/lib/krb5/asn.1/kkdcr2kdcr.c index ed294b7af..1a0a8ab69 100644 --- a/src/lib/krb5/asn.1/kkdcr2kdcr.c +++ b/src/lib/krb5/asn.1/kkdcr2kdcr.c @@ -92,9 +92,9 @@ struct element_KRB5_11 *krb5_pa_data2element_KRB5_11(val, error) } struct type_KRB5_TGS__REP * -krb5_kdc_rep2KRB5_KDC__REP(DECLARG(const register krb5_kdc_rep *,val), +krb5_kdc_rep2KRB5_KDC__REP(DECLARG(register const krb5_kdc_rep *,val), DECLARG(register int *,error)) -OLDDECLARG(const register krb5_kdc_rep *,val) +OLDDECLARG(register const krb5_kdc_rep *,val) OLDDECLARG(register int *,error) { register struct type_KRB5_TGS__REP *retval; diff --git a/src/lib/krb5/asn.1/kprep2prep.c b/src/lib/krb5/asn.1/kprep2prep.c index 9c4ebc345..8235c6e85 100644 --- a/src/lib/krb5/asn.1/kprep2prep.c +++ b/src/lib/krb5/asn.1/kprep2prep.c @@ -43,7 +43,7 @@ static char rcsid_kprep2prep_c[] = struct type_KRB5_EncKrbPrivPart * krb5_priv_enc_part2KRB5_EncKrbPrivPart(val, error) -const register krb5_priv_enc_part *val; +register const krb5_priv_enc_part *val; register int *error; { register struct type_KRB5_EncKrbPrivPart *retval; diff --git a/src/lib/krb5/asn.1/kpriv2priv.c b/src/lib/krb5/asn.1/kpriv2priv.c index 656849ecb..77e1e973f 100644 --- a/src/lib/krb5/asn.1/kpriv2priv.c +++ b/src/lib/krb5/asn.1/kpriv2priv.c @@ -43,7 +43,7 @@ static char rcsid_kpriv2priv_c[] = struct type_KRB5_KRB__PRIV * krb5_priv2KRB5_KRB__PRIV(val, error) -const register krb5_priv *val; +register const krb5_priv *val; register int *error; { register struct type_KRB5_KRB__PRIV *retval; diff --git a/src/lib/krb5/asn.1/kpwd2pwd.c b/src/lib/krb5/asn.1/kpwd2pwd.c index a2fbc4541..ab9fba1c9 100644 --- a/src/lib/krb5/asn.1/kpwd2pwd.c +++ b/src/lib/krb5/asn.1/kpwd2pwd.c @@ -65,7 +65,7 @@ static char rcsid_kpwd2pwd[] = struct type_KRB5_PasswdSequence * krb5_pwd_seq2KRB5_PWD__SEQ(val, error) -const register passwd_phrase_element *val; +register const passwd_phrase_element *val; register int *error; { register struct type_KRB5_PasswdSequence *retval; diff --git a/src/lib/krb5/asn.1/ksafe2safe.c b/src/lib/krb5/asn.1/ksafe2safe.c index 59763f45f..a522e235f 100644 --- a/src/lib/krb5/asn.1/ksafe2safe.c +++ b/src/lib/krb5/asn.1/ksafe2safe.c @@ -43,7 +43,7 @@ static char rcsid_ksafe2safe_c[] = struct type_KRB5_KRB__SAFE * krb5_safe2KRB5_KRB__SAFE(val, error) -const register krb5_safe *val; +register const krb5_safe *val; register int *error; { register struct type_KRB5_KRB__SAFE *retval; diff --git a/src/lib/krb5/asn.1/ktgrq2tgrq.c b/src/lib/krb5/asn.1/ktgrq2tgrq.c index e560aa7b1..d980cb22f 100644 --- a/src/lib/krb5/asn.1/ktgrq2tgrq.c +++ b/src/lib/krb5/asn.1/ktgrq2tgrq.c @@ -43,7 +43,7 @@ static char rcsid_ktgrq2tgrq_c[] = struct type_KRB5_KDC__REQ__BODY * krb5_kdc_req2KRB5_KDC__REQ__BODY(val, error) -const register krb5_kdc_req *val; +register const krb5_kdc_req *val; register int *error; { register struct type_KRB5_KDC__REQ__BODY *retval; @@ -283,7 +283,7 @@ struct element_KRB5_7 *krb5_pa_data2element_KRB5_7(val, error) struct type_KRB5_KDC__REQ * krb5_kdc_req2KRB5_KDC__REQ(val, error) -const register krb5_kdc_req *val; +register const krb5_kdc_req *val; register int *error; { register struct type_KRB5_KDC__REQ *retval; diff --git a/src/lib/krb5/asn.1/ktgsr2kdcr.c b/src/lib/krb5/asn.1/ktgsr2kdcr.c index 6da92b1bf..6779731ec 100644 --- a/src/lib/krb5/asn.1/ktgsr2kdcr.c +++ b/src/lib/krb5/asn.1/ktgsr2kdcr.c @@ -43,7 +43,7 @@ static char rcsid_ktgsr2kdcr_c[] = struct type_KRB5_TGS__REP * krb5_tgs_rep2KRB5_KDC__REP(val, error) -const register krb5_kdc_rep *val; +register const krb5_kdc_rep *val; register int *error; { return (struct type_KRB5_TGS__REP *) diff --git a/src/lib/krb5/asn.1/ktkt2tkt.c b/src/lib/krb5/asn.1/ktkt2tkt.c index 89ee2443a..023de917a 100644 --- a/src/lib/krb5/asn.1/ktkt2tkt.c +++ b/src/lib/krb5/asn.1/ktkt2tkt.c @@ -43,7 +43,7 @@ static char rcsid_ktkt2tkt_c[] = struct type_KRB5_Ticket * krb5_ticket2KRB5_Ticket(val, error) -const register krb5_ticket *val; +register const krb5_ticket *val; register int *error; { register struct type_KRB5_Ticket *retval; diff --git a/src/lib/krb5/asn.1/ktran2tran.c b/src/lib/krb5/asn.1/ktran2tran.c index e39405658..5e66e855f 100644 --- a/src/lib/krb5/asn.1/ktran2tran.c +++ b/src/lib/krb5/asn.1/ktran2tran.c @@ -43,7 +43,7 @@ static char rcsid_ktran2tran_c[] = struct type_KRB5_TransitedEncoding * krb5_transited2KRB5_TransitedEncoding(val, error) -const register krb5_transited *val; +register const krb5_transited *val; register int *error; { register struct type_KRB5_TransitedEncoding *retval; diff --git a/src/lib/krb5/asn.1/prep2kprep.c b/src/lib/krb5/asn.1/prep2kprep.c index 85195c3b9..78a5d5baf 100644 --- a/src/lib/krb5/asn.1/prep2kprep.c +++ b/src/lib/krb5/asn.1/prep2kprep.c @@ -43,7 +43,7 @@ static char rcsid_prep2kprep_c[] = krb5_priv_enc_part * KRB5_EncKrbPrivPart2krb5_priv_enc_part(val, error) -const register struct type_KRB5_EncKrbPrivPart *val; +register const struct type_KRB5_EncKrbPrivPart *val; register int *error; { register krb5_priv_enc_part *retval; diff --git a/src/lib/krb5/asn.1/prin2kprin.c b/src/lib/krb5/asn.1/prin2kprin.c index f64211592..a586dca4f 100644 --- a/src/lib/krb5/asn.1/prin2kprin.c +++ b/src/lib/krb5/asn.1/prin2kprin.c @@ -76,7 +76,6 @@ register int *error; for (i = 1, rv = val->name__string; rv->next; i++, rv = rv->next) ; - /* plus one for the realm */ retval->length = i; retval->data = (krb5_data *)malloc(i * sizeof(krb5_data)); if (retval->data == 0) { @@ -99,6 +98,10 @@ register int *error; while (--i >= 0) free(krb5_princ_component(retval, i)->data); *error = ENOMEM; + if (retval->realm.data) + krb5_xfree(retval->realm.data); + krb5_xfree(retval->data); + krb5_xfree(retval); return(0); } return(retval); diff --git a/src/lib/krb5/asn.1/priv2kpriv.c b/src/lib/krb5/asn.1/priv2kpriv.c index dbf447a72..9ddb4ae88 100644 --- a/src/lib/krb5/asn.1/priv2kpriv.c +++ b/src/lib/krb5/asn.1/priv2kpriv.c @@ -43,7 +43,7 @@ static char rcsid_priv2kpriv_c[] = krb5_priv * KRB5_KRB__PRIV2krb5_priv(val, error) -const register struct type_KRB5_KRB__PRIV *val; +register const struct type_KRB5_KRB__PRIV *val; register int *error; { register krb5_priv *retval; diff --git a/src/lib/krb5/asn.1/pwd2kpwd.c b/src/lib/krb5/asn.1/pwd2kpwd.c index 5349c8006..3cd4a36c4 100644 --- a/src/lib/krb5/asn.1/pwd2kpwd.c +++ b/src/lib/krb5/asn.1/pwd2kpwd.c @@ -43,7 +43,7 @@ static char rcsid_pwd2kpwd[] = passwd_phrase_element * KRB5_PWD__SEQ2krb5_pwd_seq(val, error) -const register struct type_KRB5_PasswdSequence *val; +register const struct type_KRB5_PasswdSequence *val; register int *error; { register passwd_phrase_element *retval; diff --git a/src/lib/krb5/asn.1/pwds2kpwds.c b/src/lib/krb5/asn.1/pwds2kpwds.c index bffa2d578..148097ba9 100644 --- a/src/lib/krb5/asn.1/pwds2kpwds.c +++ b/src/lib/krb5/asn.1/pwds2kpwds.c @@ -41,7 +41,7 @@ static char rcsid_pwds2kpwds[] = krb5_pwd_data * KRB5_PWD__DATA2krb5_pwd_data(val, error) -const register struct type_KRB5_PasswdData *val; +register const struct type_KRB5_PasswdData *val; register int *error; { register krb5_pwd_data *retval; diff --git a/src/lib/krb5/asn.1/safe2ksafe.c b/src/lib/krb5/asn.1/safe2ksafe.c index bd3121f6b..57484139a 100644 --- a/src/lib/krb5/asn.1/safe2ksafe.c +++ b/src/lib/krb5/asn.1/safe2ksafe.c @@ -43,7 +43,7 @@ static char rcsid_safe2ksafe_c[] = krb5_safe * KRB5_KRB__SAFE2krb5_safe(val, error) -const register struct type_KRB5_KRB__SAFE *val; +register const struct type_KRB5_KRB__SAFE *val; register int *error; { register krb5_safe *retval; diff --git a/src/lib/krb5/asn.1/tgrq2ktgrq.c b/src/lib/krb5/asn.1/tgrq2ktgrq.c index 677557464..5caf36211 100644 --- a/src/lib/krb5/asn.1/tgrq2ktgrq.c +++ b/src/lib/krb5/asn.1/tgrq2ktgrq.c @@ -46,7 +46,7 @@ static char rcsid_tgrq2ktgrq_c[] = krb5_kdc_req * KRB5_KDC__REQ__BODY2krb5_kdc_req(val, error) -const register struct type_KRB5_KDC__REQ__BODY *val; +register const struct type_KRB5_KDC__REQ__BODY *val; register int *error; { register krb5_kdc_req *retval; @@ -253,7 +253,7 @@ element_KRB5_72krb5_pa_data(val, error) krb5_kdc_req * KRB5_KDC__REQ2krb5_kdc_req(val, error) -const register struct type_KRB5_KDC__REQ *val; +register const struct type_KRB5_KDC__REQ *val; register int *error; { register krb5_kdc_req *retval; diff --git a/src/lib/krb5/asn.1/tkt2ktkt.c b/src/lib/krb5/asn.1/tkt2ktkt.c index e05873d34..1af077727 100644 --- a/src/lib/krb5/asn.1/tkt2ktkt.c +++ b/src/lib/krb5/asn.1/tkt2ktkt.c @@ -43,7 +43,7 @@ static char rcsid_tkt2ktkt_c[] = krb5_ticket * KRB5_Ticket2krb5_ticket(val, error) -const register struct type_KRB5_Ticket *val; +register const struct type_KRB5_Ticket *val; register int *error; { register krb5_ticket *retval; diff --git a/src/lib/krb5/asn.1/tran2ktran.c b/src/lib/krb5/asn.1/tran2ktran.c index 6a9ff4996..1d0bb7ae1 100644 --- a/src/lib/krb5/asn.1/tran2ktran.c +++ b/src/lib/krb5/asn.1/tran2ktran.c @@ -43,7 +43,7 @@ static char rcsid_tran2ktran_c[] = krb5_transited * KRB5_TransitedEncoding2krb5_transited(val, error) -const register struct type_KRB5_TransitedEncoding *val; +register const struct type_KRB5_TransitedEncoding *val; register int *error; { register krb5_transited *retval; -- 2.26.2