projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5a89b6e
)
Fix a couple of resource leaks on exceptions being thrown.
author
Carl Hetherington
<cth@carlh.net>
Tue, 16 Jul 2013 12:02:54 +0000
(13:02 +0100)
committer
Carl Hetherington
<cth@carlh.net>
Tue, 16 Jul 2013 12:02:54 +0000
(13:02 +0100)
src/lib/scp_dcp_job.cc
patch
|
blob
|
history
diff --git
a/src/lib/scp_dcp_job.cc
b/src/lib/scp_dcp_job.cc
index 8cde44f0258a2d65ad8a4a44fa437b653f216c2d..528d393a36d73e559e0ca8b9d45b1e973ea87a3a 100644
(file)
--- 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;