[1603] in Kerberos-V5-bugs
duplicate free in lib/gssapi/krb5/init_sec_context.c
daemon@ATHENA.MIT.EDU (Derek Atkins)
Wed Aug 23 19:57:10 1995
Date: Wed, 23 Aug 1995 16:57:23 -0700
From: Derek Atkins <warlord@Eng.Sun.COM>
To: krb5-bugs@MIT.EDU
When running purify I found two problems in
lib/gssapi/krb5/init_sec_context.c. The first problem was that the
req_flags were never initialized. The second problem was that there
were duplicate frees (actually, a whole duplicated section of code).
This patch fixes both problems.
-derek
------- init_sec_context.c -------
*** /tmp/da000Mo Wed Dec 31 16:00:00 1969
--- lib/gssapi/krb5/init_sec_context.c Wed Aug 23 11:56:59 1995
***************
*** 36,42 ****
krb5_flags *flags;
gss_buffer_t token;
{
! krb5_flags mk_req_flags;
krb5_error_code code;
krb5_data checksum_data;
krb5_checksum md5;
--- 36,42 ----
krb5_flags *flags;
gss_buffer_t token;
{
! krb5_flags mk_req_flags = 0;
krb5_error_code code;
krb5_data checksum_data;
krb5_checksum md5;
***************
*** 427,453 ****
return(GSS_S_FAILURE);
}
}
-
- /* store away the sequence number */
- ctx->seq_recv = ap_rep_data->seq_number;
-
- /* free the ap_rep_data */
- krb5_free_ap_rep_enc_part(context, ap_rep_data);
-
- /* set established */
- ctx->established = 1;
-
- /* set returns */
-
- if (time_rec) {
- if (code = krb5_timeofday(context, &now)) {
- (void)krb5_gss_delete_sec_context(context, minor_status,
- (gss_ctx_id_t) ctx, NULL);
- *minor_status = code;
- return(GSS_S_FAILURE);
-
- }
- }
/* store away the sequence number */
ctx->seq_recv = ap_rep_data->seq_number;
--- 427,432 ----