From: John Kohl Date: Mon, 26 Mar 1990 16:51:05 +0000 (+0000) Subject: cleanup #defines of cleanup() X-Git-Tag: krb5-1.0-alpha2~969 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=19cdc8c619269e200675eaff50b473501bad9bbf;p=krb5.git cleanup #defines of cleanup() git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@419 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kdc/do_as_req.c b/src/kdc/do_as_req.c index 53978b4e2..ff554f348 100644 --- a/src/kdc/do_as_req.c +++ b/src/kdc/do_as_req.c @@ -112,7 +112,11 @@ krb5_data **response; /* filled in with a response packet */ } #undef cleanup -#define cleanup() {krb5_db_free_principal(&client, 1); krb5_db_free_principal(&server, 1); bzero((char *)session_key->contents, session_key->length); free((char *)session_key->contents); session_key->contents = 0; } +#define cleanup() {krb5_db_free_principal(&client, 1); \ + krb5_db_free_principal(&server, 1); \ + bzero((char *)session_key->contents, session_key->length); \ + free((char *)session_key->contents); \ + session_key->contents = 0; } ticket_reply.server = request->server; @@ -215,8 +219,13 @@ krb5_data **response; /* filled in with a response packet */ krb5_db_free_principal(&server, 1); #undef cleanup -#define cleanup() {krb5_db_free_principal(&client, 1);bzero((char *)session_key->contents, session_key->length); free((char *)session_key->contents); session_key->contents = 0; bzero(ticket_reply.enc_part.data, ticket_reply.enc_part.length); free(ticket_reply.enc_part.data);} - +#define cleanup() {krb5_db_free_principal(&client, 1); \ + bzero((char *)session_key->contents, session_key->length); \ + free((char *)session_key->contents); \ + session_key->contents = 0; \ + bzero(ticket_reply.enc_part.data, \ + ticket_reply.enc_part.length); \ + free(ticket_reply.enc_part.data);} /* Start assembling the response */ reply.client = request->client; diff --git a/src/kdc/do_tgs_req.c b/src/kdc/do_tgs_req.c index 41952f932..39f1faa26 100644 --- a/src/kdc/do_tgs_req.c +++ b/src/kdc/do_tgs_req.c @@ -129,7 +129,13 @@ krb5_data **response; /* filled in with a response packet */ } #undef cleanup -#define cleanup() {krb5_db_free_principal(&server, 1); bzero((char *)session_key->contents, session_key->length); free((char *)session_key->contents); session_key->contents = 0; if (second_ticket) {krb5_free_enc_tkt_part(second_ticket->enc_part2); second_ticket->enc_part2 = 0;}} +#define cleanup() {krb5_db_free_principal(&server, 1); \ + bzero((char *)session_key->contents, session_key->length); \ + free((char *)session_key->contents); \ + session_key->contents = 0; \ + if (second_ticket) { \ + krb5_free_enc_tkt_part(second_ticket->enc_part2); \ + second_ticket->enc_part2 = 0;}} ticket_reply.server = realreq->server; /* XXX careful for realm... */ ticket_reply.etype = realreq->etype; @@ -312,7 +318,14 @@ krb5_data **response; /* filled in with a response packet */ newtransited = 1; } #undef cleanup -#define cleanup() {krb5_db_free_principal(&server, 1); bzero((char *)session_key->contents, session_key->length);free((char *)session_key->contents); session_key->contents = 0; if (second_ticket) {krb5_free_enc_tkt_part(second_ticket->enc_part2); second_ticket->enc_part2 = 0;} if (newtransited) free(enc_tkt_reply.transited.data);} +#define cleanup() {krb5_db_free_principal(&server, 1); \ + bzero((char *)session_key->contents, session_key->length); \ + free((char *)session_key->contents); \ + session_key->contents = 0; \ + if (second_ticket) { \ + krb5_free_enc_tkt_part(second_ticket->enc_part2); \ + second_ticket->enc_part2 = 0;} \ + if (newtransited) free(enc_tkt_reply.transited.data);} ticket_reply.enc_part2 = &enc_tkt_reply; if (isflagset(realreq->kdc_options, KDC_OPT_ENC_TKT_IN_SKEY)) {