r4042: fix segfault on server schannel connections
authorStefan Metzmacher <metze@samba.org>
Thu, 2 Dec 2004 12:12:26 +0000 (12:12 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:06:17 +0000 (13:06 -0500)
metze
(This used to be commit 57bd26f9c528687ca2ca9bbaa56f7f36efd2231f)

source4/librpc/rpc/dcerpc_schannel.c

index 4016f2d5d613ca71b7ac6fe0c27e0640f4c403e6..5d6a995cff1bba99ca1b668ba53b58719ff1aa40 100644 (file)
@@ -258,7 +258,10 @@ NTSTATUS dcerpc_schannel_creds(struct gensec_security *gensec_security,
 { 
        struct dcerpc_schannel_state *dce_schan_state = gensec_security->private_data;
 
-       *creds = dce_schan_state->creds;
+       *creds = talloc_reference(mem_ctx, dce_schan_state->creds);
+       if (!*creds) {
+               return NT_STATUS_NO_MEMORY;
+       }
        return NT_STATUS_OK;
 }