diff options
author | Stefan Metzmacher <metze@samba.org> | 2018-08-29 04:24:46 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2018-09-04 10:45:10 +0200 |
commit | 7356e814dfd3921e465a16cfe4b7998bc6f92dd1 (patch) | |
tree | fd3dd242294a4ff2ab225df21cf6723e271c9289 /source3 | |
parent | c86f6c2916c0c87efffe2d5b48f231a073b8c33e (diff) | |
download | samba-7356e814dfd3921e465a16cfe4b7998bc6f92dd1.tar.gz |
s3:vfs: fix valgrind warning in SMB_VFS_{PREAD,PWRITE,FSYNC}_RECV()
tevent_req_received() destroys 'state', so we need helper variables
to hold the return value.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Sep 4 10:45:10 CEST 2018 on sn-devel-144
Diffstat (limited to 'source3')
-rw-r--r-- | source3/smbd/vfs.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index 2687e3540b8..a6c49cfad34 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -2579,14 +2579,16 @@ ssize_t SMB_VFS_PREAD_RECV(struct tevent_req *req, { struct smb_vfs_call_pread_state *state = tevent_req_data( req, struct smb_vfs_call_pread_state); + ssize_t retval; if (tevent_req_is_unix_error(req, &vfs_aio_state->error)) { tevent_req_received(req); return -1; } *vfs_aio_state = state->vfs_aio_state; + retval = state->retval; tevent_req_received(req); - return state->retval; + return retval; } ssize_t smb_vfs_call_pwrite(struct vfs_handle_struct *handle, @@ -2653,14 +2655,16 @@ ssize_t SMB_VFS_PWRITE_RECV(struct tevent_req *req, { struct smb_vfs_call_pwrite_state *state = tevent_req_data( req, struct smb_vfs_call_pwrite_state); + ssize_t retval; if (tevent_req_is_unix_error(req, &vfs_aio_state->error)) { tevent_req_received(req); return -1; } *vfs_aio_state = state->vfs_aio_state; + retval = state->retval; tevent_req_received(req); - return state->retval; + return retval; } off_t smb_vfs_call_lseek(struct vfs_handle_struct *handle, @@ -2748,14 +2752,16 @@ int SMB_VFS_FSYNC_RECV(struct tevent_req *req, struct vfs_aio_state *vfs_aio_sta { struct smb_vfs_call_fsync_state *state = tevent_req_data( req, struct smb_vfs_call_fsync_state); + ssize_t retval; if (tevent_req_is_unix_error(req, &vfs_aio_state->error)) { tevent_req_received(req); return -1; } *vfs_aio_state = state->vfs_aio_state; + retval = state->retval; tevent_req_received(req); - return state->retval; + return retval; } /* |