summaryrefslogtreecommitdiff
path: root/sftp-client.c
diff options
context:
space:
mode:
authordtucker@openbsd.org <dtucker@openbsd.org>2023-03-28 07:44:32 +0000
committerDarren Tucker <dtucker@dtucker.net>2023-03-28 19:03:54 +1100
commit9ffa76e1284c85bf459c3dcb8e995733a8967e1b (patch)
tree78657a1e5c42da18d74aad41785d5cc5b2134f98 /sftp-client.c
parent82b2b8326962b1a98af279bc5bbbbbcab15b3e45 (diff)
downloadopenssh-git-9ffa76e1284c85bf459c3dcb8e995733a8967e1b.tar.gz
upstream: Plug more mem leaks in sftp by making
make_absolute_pwd_glob work in the same way as make_absolute: you pass it a dynamically allocated string and it either returns it, or frees it and allocates a new one. Patch from emaste at freebsd.org and https://reviews.freebsd.org/D37253 ok djm@ OpenBSD-Commit-ID: 85f7404e9d47fd28b222fbc412678f3361d2dffc
Diffstat (limited to 'sftp-client.c')
-rw-r--r--sftp-client.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sftp-client.c b/sftp-client.c
index 87b4d142..29f4c64d 100644
--- a/sftp-client.c
+++ b/sftp-client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp-client.c,v 1.169 2023/03/08 04:43:12 guenther Exp $ */
+/* $OpenBSD: sftp-client.c,v 1.170 2023/03/28 07:44:32 dtucker Exp $ */
/*
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
*
@@ -2895,6 +2895,10 @@ path_append(const char *p1, const char *p2)
return(ret);
}
+/*
+ * Arg p must be dynamically allocated. It will either be returned or
+ * freed and a replacement allocated. Caller must free returned string.
+ */
char *
make_absolute(char *p, const char *pwd)
{