aboutsummaryrefslogtreecommitdiff
path: root/crypto/openssh/sftp.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/openssh/sftp.c')
-rw-r--r--crypto/openssh/sftp.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/crypto/openssh/sftp.c b/crypto/openssh/sftp.c
index ce7ab7f8f2fe..b113f930973d 100644
--- a/crypto/openssh/sftp.c
+++ b/crypto/openssh/sftp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp.c,v 1.229 2023/03/12 09:41:18 dtucker Exp $ */
+/* $OpenBSD: sftp.c,v 1.234 2023/04/12 08:53:54 jsg Exp $ */
/*
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
*
@@ -225,7 +225,7 @@ killchild(int signo)
pid = sshpid;
if (pid > 1) {
kill(pid, SIGTERM);
- waitpid(pid, NULL, 0);
+ (void)waitpid(pid, NULL, 0);
}
_exit(1);
@@ -616,6 +616,10 @@ escape_glob(const char *s)
return ret;
}
+/*
+ * Arg p must be dynamically allocated. make_absolute will either return it
+ * or free it and allocate a new one. Caller must free returned string.
+ */
static char *
make_absolute_pwd_glob(char *p, const char *pwd)
{
@@ -765,6 +769,8 @@ process_put(struct sftp_conn *conn, const char *src, const char *dst,
goto out;
}
+ free(abs_dst);
+ abs_dst = NULL;
if (g.gl_matchc == 1 && tmp_dst) {
/* If directory specified, append filename */
if (dst_is_dir)
@@ -2000,7 +2006,7 @@ complete_match(EditLine *el, struct sftp_conn *conn, char *remote_path,
tmp = make_absolute_pwd_glob(tmp, remote_path);
remote_glob(conn, tmp, GLOB_DOOFFS|GLOB_MARK, NULL, &g);
} else
- glob(tmp, GLOB_DOOFFS|GLOB_MARK, NULL, &g);
+ (void)glob(tmp, GLOB_DOOFFS|GLOB_MARK, NULL, &g);
/* Determine length of pwd so we can trim completion display */
for (hadglob = tmplen = pwdlen = 0; tmp[tmplen] != 0; tmplen++) {