diff options
author | dtucker@openbsd.org <dtucker@openbsd.org> | 2023-03-28 09:44:32 +0200 |
---|---|---|
committer | Darren Tucker <dtucker@dtucker.net> | 2023-03-28 10:03:54 +0200 |
commit | 9ffa76e1284c85bf459c3dcb8e995733a8967e1b (patch) | |
tree | 78657a1e5c42da18d74aad41785d5cc5b2134f98 /sftp-client.c | |
parent | upstream: Remove compat code for OpenSSL < 1.1.* (diff) | |
download | openssh-9ffa76e1284c85bf459c3dcb8e995733a8967e1b.tar.xz openssh-9ffa76e1284c85bf459c3dcb8e995733a8967e1b.zip |
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.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sftp-client.c b/sftp-client.c index 87b4d142a..29f4c64d1 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) { |