summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkus <markus@openbsd.org>2002-02-24 16:57:19 +0000
committermarkus <markus@openbsd.org>2002-02-24 16:57:19 +0000
commit823ec85471fdd38b156458663c20da83049288d3 (patch)
tree01303f499228f310c06c34a63d6bf632ed8c3190
parentuse u_char* here; ok markus@ (diff)
downloadwireguard-openbsd-823ec85471fdd38b156458663c20da83049288d3.tar.xz
wireguard-openbsd-823ec85471fdd38b156458663c20da83049288d3.zip
early close(), missing free; ok stevesk@
-rw-r--r--usr.bin/ssh/sftp-client.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/ssh/sftp-client.c b/usr.bin/ssh/sftp-client.c
index 215cd63a40e..10ac13d7f49 100644
--- a/usr.bin/ssh/sftp-client.c
+++ b/usr.bin/ssh/sftp-client.c
@@ -28,7 +28,7 @@
/* XXX: copy between two remote sites */
#include "includes.h"
-RCSID("$OpenBSD: sftp-client.c,v 1.23 2002/02/13 00:59:23 djm Exp $");
+RCSID("$OpenBSD: sftp-client.c,v 1.24 2002/02/24 16:57:19 markus Exp $");
#include <sys/queue.h>
@@ -795,7 +795,6 @@ do_download(struct sftp_conn *conn, char *remote_path, char *local_path,
handle = get_handle(conn->fd_in, id, &handle_len);
if (handle == NULL) {
buffer_free(&msg);
- close(local_fd);
return(-1);
}
@@ -803,6 +802,8 @@ 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));
+ buffer_free(&msg);
+ xfree(handle);
return(-1);
}