pull up r18288 from trunk
authorTom Yu <tlyu@mit.edu>
Fri, 30 Jun 2006 20:20:51 +0000 (20:20 +0000)
committerTom Yu <tlyu@mit.edu>
Fri, 30 Jun 2006 20:20:51 +0000 (20:20 +0000)
 r18288@cathode-dark-space:  jaltman | 2006-06-30 05:22:32 -0400
 ticket: new
 subject: 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: 3968
version_fixed: 1.5

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-5@18293 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/gssapi/mechglue/g_delete_sec_context.c
src/lib/gssapi/mechglue/g_init_sec_context.c

index de70b8fb79e61a5d898ea1b09a6dc5a333689423..d5588b75b9470b180fa4ed1679fd0627ff054b53 100644 (file)
@@ -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) {
index 53252f798a53090fb74736d7bf9a7e15426b37ac..f5937fe8eeab488908675b69b1faf36b53170587 100644 (file)
@@ -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;