Skip to content

Commit

Permalink
Remove unneeded variable enc_tkt_transited
Browse files Browse the repository at this point in the history
There's no need to use an intermediate variable to initialize the
contents of enc_tkt_reply.transited.

Instead of setting each field to zero individually (and misspelling NULL),
use memset and set the one field which is being initialized to a nonzero
value explicitly.
  • Loading branch information
kaduk committed Oct 4, 2013
1 parent 040f621 commit 36c8a47
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/kdc/do_tgs_req.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ process_tgs_req(struct server_handle *handle, krb5_data *pkt,
krb5_ticket ticket_reply, *header_ticket = 0;
int st_idx = 0;
krb5_enc_tkt_part enc_tkt_reply;
krb5_transited enc_tkt_transited;
int newtransited = 0;
krb5_error_code retval = 0;
krb5_keyblock encrypting_key;
Expand Down Expand Up @@ -584,12 +583,8 @@ process_tgs_req(struct server_handle *handle, krb5_data *pkt,
errcode = KRB5KDC_ERR_TRTYPE_NOSUPP;
goto cleanup;
}
enc_tkt_transited.tr_type = KRB5_DOMAIN_X500_COMPRESS;
enc_tkt_transited.magic = 0;
enc_tkt_transited.tr_contents.magic = 0;
enc_tkt_transited.tr_contents.data = 0;
enc_tkt_transited.tr_contents.length = 0;
enc_tkt_reply.transited = enc_tkt_transited;
memset(&enc_tkt_reply.transited, 0, sizeof(enc_tkt_reply.transited));
enc_tkt_reply.transited.tr_type = KRB5_DOMAIN_X500_COMPRESS;
if ((errcode =
add_to_transited(&header_enc_tkt->transited.tr_contents,
&enc_tkt_reply.transited.tr_contents,
Expand Down

0 comments on commit 36c8a47

Please sign in to comment.