summaryrefslogtreecommitdiffstats
path: root/source3/smbd
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2013-10-16 09:15:12 +0200
committerStefan Metzmacher <metze@samba.org>2013-11-27 14:39:10 +0100
commit9d33a3f3e814e2924a423496ccc133c6c73fcd12 (patch)
treeb18a7446e5a9de88e3dee4c4c6f8d4f77abd9c7c /source3/smbd
parentacfd4b068a5b99ac1d3fe716afff34cb7d2a0147 (diff)
downloadsamba-9d33a3f3e814e2924a423496ccc133c6c73fcd12.tar.gz
samba-9d33a3f3e814e2924a423496ccc133c6c73fcd12.tar.xz
samba-9d33a3f3e814e2924a423496ccc133c6c73fcd12.zip
s3:smb2_server: allocate smbd_smb2_request on talloc_tos()
This matches the behavior for smb1 requests and avoids an additional malloc() per request. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/smb2_server.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c
index 56dd6945a9..ee5747d227 100644
--- a/source3/smbd/smb2_server.c
+++ b/source3/smbd/smb2_server.c
@@ -269,7 +269,7 @@ static struct smbd_smb2_request *smbd_smb2_request_allocate(TALLOC_CTX *mem_ctx)
/* Enable this to find subtle valgrind errors. */
mem_pool = talloc_init("smbd_smb2_request_allocate");
#else
- mem_pool = talloc_pool(mem_ctx, 8192);
+ mem_pool = talloc_tos();
#endif
if (mem_pool == NULL) {
return NULL;
@@ -281,7 +281,9 @@ static struct smbd_smb2_request *smbd_smb2_request_allocate(TALLOC_CTX *mem_ctx)
return NULL;
}
talloc_reparent(mem_pool, mem_ctx, req);
+#if 0
TALLOC_FREE(mem_pool);
+#endif
req->last_session_id = UINT64_MAX;
req->last_tid = UINT32_MAX;