From fd469bae9edfcb16b51f3572756ef21c72054e5f Mon Sep 17 00:00:00 2001 From: Gilbert Chen Date: Sat, 29 Aug 2020 22:22:51 -0400 Subject: [PATCH] Check the returned value of Close() when uploading a chunk file via SFTP. --- src/duplicacy_sftpstorage.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/duplicacy_sftpstorage.go b/src/duplicacy_sftpstorage.go index 5f741ee3..df379c1c 100644 --- a/src/duplicacy_sftpstorage.go +++ b/src/duplicacy_sftpstorage.go @@ -318,7 +318,11 @@ func (storage *SFTPStorage) UploadFile(threadIndex int, filePath string, content file.Close() return err } - file.Close() + + err = file.Close() + if err != nil { + return err + } err = storage.getSFTPClient().Rename(temporaryFile, fullPath) if err != nil {