From: Jeffrey Altman Date: Fri, 30 Jun 2006 09:22:32 +0000 (+0000) Subject: corrections to gssapi mechglue X-Git-Tag: krb5-1.6-alpha1~227 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bbc76278c9daf517b8f6bea45207a6b176f5ec0d;p=krb5.git corrections to gssapi mechglue g_delete_sec_context.c: use the correct type during assignment g_init_sec_context.c; prevent memory leak and make code more readable ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18288 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/gssapi/mechglue/g_delete_sec_context.c b/src/lib/gssapi/mechglue/g_delete_sec_context.c index de70b8fb7..d5588b75b 100644 --- a/src/lib/gssapi/mechglue/g_delete_sec_context.c +++ b/src/lib/gssapi/mechglue/g_delete_sec_context.c @@ -63,7 +63,7 @@ gss_buffer_t output_token; * call it. */ - ctx = (gss_union_ctx_id_t) *context_handle; + ctx = (gss_union_ctx_id_t *) *context_handle; mech = gssint_get_mechanism (ctx->mech_type); if (mech) { diff --git a/src/lib/gssapi/mechglue/g_init_sec_context.c b/src/lib/gssapi/mechglue/g_init_sec_context.c index 53252f798..f5937fe8e 100644 --- a/src/lib/gssapi/mechglue/g_init_sec_context.c +++ b/src/lib/gssapi/mechglue/g_init_sec_context.c @@ -146,9 +146,6 @@ OM_uint32 * time_rec; if (union_ctx_id == NULL) goto end; - union_ctx_id->mech_type = (gss_OID) - malloc(sizeof(gss_OID_desc)); - if (generic_gss_copy_oid(&temp_minor_status, mech_type, &union_ctx_id->mech_type) != GSS_S_COMPLETE) { free(union_ctx_id); @@ -156,7 +153,7 @@ OM_uint32 * time_rec; } /* copy the supplied context handle */ - union_ctx_id->internal_ctx_id = *context_handle; + union_ctx_id->internal_ctx_id = GSS_C_NO_CONTEXT; } else union_ctx_id = *context_handle;