X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fscp_dcp_job.cc;h=528d393a36d73e559e0ca8b9d45b1e973ea87a3a;hb=19dc3455d7112427e0470e58133d25bcb031e9f1;hp=8cde44f0258a2d65ad8a4a44fa437b653f216c2d;hpb=5fd5e78c51bd5630f6777001db5aa25103218c22;p=dcpomatic.git diff --git a/src/lib/scp_dcp_job.cc b/src/lib/scp_dcp_job.cc index 8cde44f02..528d393a3 100644 --- a/src/lib/scp_dcp_job.cc +++ b/src/lib/scp_dcp_job.cc @@ -179,11 +179,13 @@ SCPDCPJob::run () int const t = min (to_do, buffer_size); size_t const read = fread (buffer, 1, t, f); if (read != size_t (t)) { + fclose (f); throw ReadFileError (boost::filesystem::path (*i).string()); } r = ssh_scp_write (sc.scp, buffer, t); if (r != SSH_OK) { + fclose (f); throw NetworkError (String::compose (_("Could not write to remote file (%1)"), ssh_get_error (ss.session))); } to_do -= t;