From 893c62d38388b20c52cf3c45069d836c46f42bd3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 8 Sep 2004 05:39:06 +0000 Subject: r2249: got rid of some more mem_ctx elements in structures (This used to be commit 21ef338cbbe96acc8594ffc550ef60c6a40fb951) --- source4/smb_server/smb_server.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'source4/smb_server/smb_server.c') diff --git a/source4/smb_server/smb_server.c b/source4/smb_server/smb_server.c index d12915957e..a413a7dd4b 100644 --- a/source4/smb_server/smb_server.c +++ b/source4/smb_server/smb_server.c @@ -76,7 +76,7 @@ static struct smbsrv_request *receive_smb_request(struct smbsrv_connection *smb_ req->chained_fnum = -1; /* allocate the incoming buffer at the right size */ - req->in.buffer = talloc(req->mem_ctx, len + NBT_HDR_SIZE); + req->in.buffer = talloc(req, len + NBT_HDR_SIZE); /* fill in the already received header */ memcpy(req->in.buffer, header, 4); @@ -783,7 +783,7 @@ static void smbsrv_close(struct server_connection *conn, const char *reason) conn_close_all(smb_conn); - talloc_free(smb_conn->mem_ctx); + talloc_free(smb_conn); return; } @@ -822,19 +822,18 @@ void smbsrv_accept(struct server_connection *conn) mem_ctx = talloc_init("smbsrv_context"); - smb_conn = talloc_p(mem_ctx, struct smbsrv_connection); + smb_conn = talloc_p(conn, struct smbsrv_connection); if (!smb_conn) return; ZERO_STRUCTP(smb_conn); - smb_conn->mem_ctx = mem_ctx; smb_conn->pid = getpid(); sub_set_context(&smb_conn->substitute); /* set an initial client name based on its IP address. This will be replaced with the netbios name later if it gives us one */ - socket_addr = get_socket_addr(smb_conn->mem_ctx, conn->socket->fde->fd); + socket_addr = get_socket_addr(smb_conn, conn->socket->fde->fd); sub_set_remote_machine(socket_addr); /* now initialise a few default values associated with this smb socket */ -- cgit