s3:smb2_server: don't assume that req->out.vector is always a valid talloc pointer
authorStefan Metzmacher <metze@samba.org>
Wed, 4 Dec 2013 14:28:11 +0000 (15:28 +0100)
committerJeremy Allison <jra@samba.org>
Wed, 5 Mar 2014 21:59:23 +0000 (13:59 -0800)
We use 'req' instead as it has the same lifetime.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/smb2_server.c

index cda36221557b3dc24403388500b3fdfc44216786..ceee35d05a235f14c9e3995ce01a657b5645f32a 100644 (file)
@@ -928,7 +928,7 @@ DATA_BLOB smbd_smb2_generate_outbody(struct smbd_smb2_request *req, size_t size)
                }
        }
 
-       return data_blob_talloc(req->out.vector, NULL, size);
+       return data_blob_talloc(req, NULL, size);
 }
 
 static NTSTATUS smbd_smb2_request_setup_out(struct smbd_smb2_request *req)
@@ -2348,7 +2348,7 @@ static NTSTATUS smbd_smb2_request_reply(struct smbd_smb2_request *req)
                        return NT_STATUS_NO_MEMORY;
                }
 
-               tf = talloc_zero_array(req->out.vector, uint8_t,
+               tf = talloc_zero_array(req, uint8_t,
                                       SMB2_TF_HDR_SIZE);
                if (tf == NULL) {
                        return NT_STATUS_NO_MEMORY;
@@ -2582,7 +2582,7 @@ NTSTATUS smbd_smb2_request_done_ex(struct smbd_smb2_request *req,
                         */
                        uint8_t *pad;
 
-                       pad = talloc_zero_array(req->out.vector,
+                       pad = talloc_zero_array(req,
                                                uint8_t, pad_size);
                        if (pad == NULL) {
                                return smbd_smb2_request_error(req,
@@ -2605,7 +2605,7 @@ NTSTATUS smbd_smb2_request_done_ex(struct smbd_smb2_request *req,
                        old_dyn = SMBD_SMB2_OUT_DYN_PTR(req);
 
                        new_size = old_size + pad_size;
-                       new_dyn = talloc_zero_array(req->out.vector,
+                       new_dyn = talloc_zero_array(req,
                                               uint8_t, new_size);
                        if (new_dyn == NULL) {
                                return smbd_smb2_request_error(req,