diff options
Diffstat (limited to 'source4/libcli/raw/clisession.c')
-rw-r--r-- | source4/libcli/raw/clisession.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source4/libcli/raw/clisession.c b/source4/libcli/raw/clisession.c index ed50601c25..30382e0837 100644 --- a/source4/libcli/raw/clisession.c +++ b/source4/libcli/raw/clisession.c @@ -33,18 +33,23 @@ /**************************************************************************** Initialize the session context ****************************************************************************/ -struct smbcli_session *smbcli_session_init(struct smbcli_transport *transport) +struct smbcli_session *smbcli_session_init(struct smbcli_transport *transport, + TALLOC_CTX *parent_ctx, BOOL primary) { struct smbcli_session *session; uint16_t flags2; uint32_t capabilities; - session = talloc_zero(transport, struct smbcli_session); + session = talloc_zero(parent_ctx, struct smbcli_session); if (!session) { return NULL; } - session->transport = talloc_reference(session, transport); + if (primary) { + session->transport = talloc_steal(session, transport); + } else { + session->transport = talloc_reference(session, transport); + } session->pid = (uint16_t)getpid(); session->vuid = UID_FIELD_INVALID; |