diff options
author | Volker Lendecke <vl@samba.org> | 2008-04-28 10:31:49 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2008-05-05 11:23:13 +0200 |
commit | d62563342e8c83d67dbcfb0c4b8e2ed886742006 (patch) | |
tree | 3eb93d7b3afde17ea6f11021eb1e1cc3e5c7a6f7 /source3/smbd/conn.c | |
parent | 2c00ff5407d5b126c8d38ceb2bcc8626ee7c0c5d (diff) | |
download | samba-d62563342e8c83d67dbcfb0c4b8e2ed886742006.tar.gz |
Remove connection_struct->mem_ctx, connection_struct is its own parent
(This used to be commit 559180f7d30606d1999399d954ceedc798c669a4)
Diffstat (limited to 'source3/smbd/conn.c')
-rw-r--r-- | source3/smbd/conn.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/source3/smbd/conn.c b/source3/smbd/conn.c index 5aedadc56b0..af18e905c08 100644 --- a/source3/smbd/conn.c +++ b/source3/smbd/conn.c @@ -92,7 +92,6 @@ thinking the server is still available. ****************************************************************************/ connection_struct *conn_new(void) { - TALLOC_CTX *mem_ctx; connection_struct *conn; int i; int find_offset = 1; @@ -140,18 +139,12 @@ find_again: return NULL; } - if ((mem_ctx=talloc_init("connection_struct"))==NULL) { - DEBUG(0,("talloc_init(connection_struct) failed!\n")); - return NULL; - } - - if (!(conn=TALLOC_ZERO_P(mem_ctx, connection_struct)) || - !(conn->params = TALLOC_P(mem_ctx, struct share_params))) { + if (!(conn=TALLOC_ZERO_P(NULL, connection_struct)) || + !(conn->params = TALLOC_P(conn, struct share_params))) { DEBUG(0,("TALLOC_ZERO() failed!\n")); - TALLOC_FREE(mem_ctx); + TALLOC_FREE(conn); return NULL; } - conn->mem_ctx = mem_ctx; conn->cnum = i; bitmap_set(bmap, i); @@ -262,7 +255,6 @@ void conn_clear_vuid_cache(uint16 vuid) void conn_free_internal(connection_struct *conn) { vfs_handle_struct *handle = NULL, *thandle = NULL; - TALLOC_CTX *mem_ctx = NULL; struct trans_state *state = NULL; /* Free vfs_connection_struct */ @@ -292,9 +284,8 @@ void conn_free_internal(connection_struct *conn) string_free(&conn->connectpath); string_free(&conn->origpath); - mem_ctx = conn->mem_ctx; ZERO_STRUCTP(conn); - talloc_destroy(mem_ctx); + talloc_destroy(conn); } /**************************************************************************** |