summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-06-12 13:55:18 -0700
committerJeremy Allison <jra@samba.org>2009-06-12 13:55:18 -0700
commitf409b00dc7100bfd574848a4d3ebd04ef3825baf (patch)
tree1f4bac0037c0d7dda4c87c4d287a38aac95c986d
parent808721f7bb8c87fd80f60054cca1ef202d6c403a (diff)
downloadsamba-f409b00dc7100bfd574848a4d3ebd04ef3825baf.tar.gz
samba-f409b00dc7100bfd574848a4d3ebd04ef3825baf.tar.bz2
samba-f409b00dc7100bfd574848a4d3ebd04ef3825baf.zip
Check for error in transfer_file return also.
Jeremy.
-rw-r--r--source3/smbd/close.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source3/smbd/close.c b/source3/smbd/close.c
index bc54bacbc8..760a2d520c 100644
--- a/source3/smbd/close.c
+++ b/source3/smbd/close.c
@@ -106,7 +106,13 @@ static NTSTATUS check_magic(struct files_struct *fsp)
return map_nt_error_from_unix(err);
}
- transfer_file(tmp_fd,outfd,(SMB_OFF_T)st.st_ex_size);
+ if (transfer_file(tmp_fd,outfd,(SMB_OFF_T)st.st_ex_size) == (SMB_OFF_T)-1) {
+ int err = errno;
+ close(tmp_fd);
+ close(outfd);
+ TALLOC_FREE(ctx);
+ return map_nt_error_from_unix(err);
+ }
close(tmp_fd);
if (close(outfd) == -1) {
TALLOC_FREE(ctx);