summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-09-24 09:36:58 +0200
committerStefan Metzmacher <metze@samba.org>2011-11-24 19:02:33 +0100
commit4958d7cb44bb7851e62926f195bd76ff9736f62f (patch)
tree0e8a1a04cf8942f217f3baedc21f81e7dff4637e /source4
parentf132ad32cc3cf81f0f6ea7d3a586b5ecec77edc8 (diff)
downloadsamba-4958d7cb44bb7851e62926f195bd76ff9736f62f.tar.gz
samba-4958d7cb44bb7851e62926f195bd76ff9736f62f.tar.bz2
samba-4958d7cb44bb7851e62926f195bd76ff9736f62f.zip
s4:libcli/smb2: use talloc_zero() in smb2_request_init()
metze
Diffstat (limited to 'source4')
-rw-r--r--source4/libcli/smb2/request.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/source4/libcli/smb2/request.c b/source4/libcli/smb2/request.c
index a2d633f855..2fcc381314 100644
--- a/source4/libcli/smb2/request.c
+++ b/source4/libcli/smb2/request.c
@@ -61,26 +61,13 @@ struct smb2_request *smb2_request_init(struct smb2_transport *transport, uint16_
body_dynamic_size = 0;
}
- req = talloc(transport, struct smb2_request);
+ req = talloc_zero(transport, struct smb2_request);
if (req == NULL) return NULL;
req->state = SMB2_REQUEST_INIT;
req->transport = transport;
- req->session = NULL;
- req->tree = NULL;
- req->recv_iov = NULL;
- req->status = NT_STATUS_OK;
- req->async.fn = NULL;
-
- ZERO_STRUCT(req->cancel);
- ZERO_STRUCT(req->in);
- ZERO_STRUCT(req->out);
-
- if (req->out.size > 0) {
- hdr_offset = req->out.size;
- } else {
- hdr_offset = NBT_HDR_SIZE;
- }
+
+ hdr_offset = NBT_HDR_SIZE;
req->out.size = hdr_offset + SMB2_HDR_BODY + body_fixed_size;
req->out.allocated = req->out.size + body_dynamic_size;