gensec_start now steals the auth_context
authorAndrew Tridgell <tridge@samba.org>
Wed, 1 Jul 2009 04:08:43 +0000 (14:08 +1000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 1 Jul 2009 05:15:37 +0000 (15:15 +1000)
source4/auth/gensec/gensec.c

index 2feb545f5358f7cfc1676645f13352818a1d7c5f..1addf937d086a289dd1a302bf2c3b4e4fba59ba0 100644 (file)
@@ -504,6 +504,8 @@ const char **gensec_security_oids(struct gensec_security *gensec_security,
   @param mem_ctx The parent TALLOC memory context.
   @param gensec_security Returned GENSEC context pointer.
   @note  The mem_ctx is only a parent and may be NULL.
+  @note, the auth context is moved to be a child of the
+  @ gensec_security return 
 */
 static NTSTATUS gensec_start(TALLOC_CTX *mem_ctx, 
                             struct tevent_context *ev,
@@ -532,7 +534,7 @@ static NTSTATUS gensec_start(TALLOC_CTX *mem_ctx,
        (*gensec_security)->event_ctx = ev;
        SMB_ASSERT(settings->lp_ctx != NULL);
        (*gensec_security)->settings = talloc_reference(*gensec_security, settings);
-       (*gensec_security)->auth_context = talloc_reference(*gensec_security, auth_context);
+       (*gensec_security)->auth_context = talloc_steal(*gensec_security, auth_context);
 
        return NT_STATUS_OK;
 }