summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2008-01-19 22:04:58 +0000
committerDamien Miller <djm@cvs.openbsd.org>2008-01-19 22:04:58 +0000
commitf370e77d144ae82e4bdbf376b3e70fe49fcd461e (patch)
tree7dbfcaab71fd7c6aeab28842015d96262b49dcce /usr.bin
parent7a215b45c03066737dee88d33bb34f82615fa5b6 (diff)
fix remote handle leak in do_download() local file open error path;
report and fix from sworley AT chkno.net
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ssh/sftp-client.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/ssh/sftp-client.c b/usr.bin/ssh/sftp-client.c
index bfc7d084909..3a50f6994b6 100644
--- a/usr.bin/ssh/sftp-client.c
+++ b/usr.bin/ssh/sftp-client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp-client.c,v 1.78 2008/01/11 07:22:27 chl Exp $ */
+/* $OpenBSD: sftp-client.c,v 1.79 2008/01/19 22:04:57 djm Exp $ */
/*
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
*
@@ -817,6 +817,7 @@ do_download(struct sftp_conn *conn, char *remote_path, char *local_path,
if (local_fd == -1) {
error("Couldn't open local file \"%s\" for writing: %s",
local_path, strerror(errno));
+ do_close(conn, handle, handle_len);
buffer_free(&msg);
xfree(handle);
return(-1);