diff options
Diffstat (limited to 'source4/librpc/rpc')
-rw-r--r-- | source4/librpc/rpc/dcerpc.c | 3 | ||||
-rw-r--r-- | source4/librpc/rpc/dcerpc_auth.c | 2 | ||||
-rw-r--r-- | source4/librpc/rpc/dcerpc_schannel.c | 12 |
3 files changed, 9 insertions, 8 deletions
diff --git a/source4/librpc/rpc/dcerpc.c b/source4/librpc/rpc/dcerpc.c index 9217c90e0e..f6c0ebc413 100644 --- a/source4/librpc/rpc/dcerpc.c +++ b/source4/librpc/rpc/dcerpc.c @@ -85,9 +85,6 @@ void dcerpc_pipe_close(struct dcerpc_pipe *p) if (!p) return; p->reference_count--; if (p->reference_count <= 0) { - if (p->security_state.generic_state) { - gensec_end(&p->security_state.generic_state); - } p->transport.shutdown_pipe(p); talloc_free(p); } diff --git a/source4/librpc/rpc/dcerpc_auth.c b/source4/librpc/rpc/dcerpc_auth.c index 844746e322..1c5556ccee 100644 --- a/source4/librpc/rpc/dcerpc_auth.c +++ b/source4/librpc/rpc/dcerpc_auth.c @@ -113,7 +113,7 @@ done: talloc_destroy(mem_ctx); if (!NT_STATUS_IS_OK(status)) { - gensec_end(&p->security_state.generic_state); + talloc_free(p->security_state.generic_state); ZERO_STRUCT(p->security_state); } else { /* Authenticated connections use the generic session key */ diff --git a/source4/librpc/rpc/dcerpc_schannel.c b/source4/librpc/rpc/dcerpc_schannel.c index 635735a55d..6df48b7dd3 100644 --- a/source4/librpc/rpc/dcerpc_schannel.c +++ b/source4/librpc/rpc/dcerpc_schannel.c @@ -436,14 +436,16 @@ NTSTATUS dcerpc_bind_auth_schannel_withkey(struct dcerpc_pipe *p, status = gensec_set_username(p->security_state.generic_state, username); if (!NT_STATUS_IS_OK(status)) { DEBUG(1, ("Failed to set schannel username to %s: %s\n", username, nt_errstr(status))); - gensec_end(&p->security_state.generic_state); + talloc_free(p->security_state.generic_state); + p->security_state.generic_state = NULL; return status; } status = gensec_set_domain(p->security_state.generic_state, domain); if (!NT_STATUS_IS_OK(status)) { DEBUG(1, ("Failed to set schannel domain to %s: %s\n", domain, nt_errstr(status))); - gensec_end(&p->security_state.generic_state); + talloc_free(p->security_state.generic_state); + p->security_state.generic_state = NULL; return status; } @@ -451,7 +453,8 @@ NTSTATUS dcerpc_bind_auth_schannel_withkey(struct dcerpc_pipe *p, if (!NT_STATUS_IS_OK(status)) { DEBUG(1, ("Failed to start SCHANNEL GENSEC backend: %s\n", nt_errstr(status))); - gensec_end(&p->security_state.generic_state); + talloc_free(p->security_state.generic_state); + p->security_state.generic_state = NULL; return status; } @@ -463,7 +466,8 @@ NTSTATUS dcerpc_bind_auth_schannel_withkey(struct dcerpc_pipe *p, if (!NT_STATUS_IS_OK(status)) { DEBUG(1, ("Failed to bind to pipe with SCHANNEL: %s\n", nt_errstr(status))); - gensec_end(&p->security_state.generic_state); + talloc_free(p->security_state.generic_state); + p->security_state.generic_state = NULL; return status; } |