diff options
Diffstat (limited to 'source4/libcli/raw/clitree.c')
-rw-r--r-- | source4/libcli/raw/clitree.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source4/libcli/raw/clitree.c b/source4/libcli/raw/clitree.c index 06963d5bc4..ce4dafca9f 100644 --- a/source4/libcli/raw/clitree.c +++ b/source4/libcli/raw/clitree.c @@ -33,16 +33,22 @@ /**************************************************************************** Initialize the tree context ****************************************************************************/ -struct smbcli_tree *smbcli_tree_init(struct smbcli_session *session) +struct smbcli_tree *smbcli_tree_init(struct smbcli_session *session, + TALLOC_CTX *parent_ctx, BOOL primary) { struct smbcli_tree *tree; - tree = talloc_zero(session, struct smbcli_tree); + tree = talloc_zero(parent_ctx, struct smbcli_tree); if (!tree) { return NULL; } - tree->session = talloc_reference(tree, session); + if (primary) { + tree->session = talloc_steal(tree, session); + } else { + tree->session = talloc_reference(tree, session); + } + return tree; } |