diff options
author | dtucker@openbsd.org <dtucker@openbsd.org> | 2023-02-27 23:12:40 +0100 |
---|---|---|
committer | Darren Tucker <dtucker@dtucker.net> | 2023-02-28 09:51:21 +0100 |
commit | 803392933a3a6f09f834aa5f0c2aab06a3b382f4 (patch) | |
tree | 1a06d820cea8a9432b8ec0f9190413236c616dc9 /sftp.c | |
parent | Cast time_t's in debug output to long long. (diff) | |
download | openssh-803392933a3a6f09f834aa5f0c2aab06a3b382f4.tar.xz openssh-803392933a3a6f09f834aa5f0c2aab06a3b382f4.zip |
upstream: Plug mem leak on globbed ls error path.
Spotted by Coverity, ok deraadt@
OpenBSD-Commit-ID: de28476025db29820a9a2e56e98b964d8a02861c
Diffstat (limited to 'sftp.c')
-rw-r--r-- | sftp.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1,4 +1,4 @@ -/* $OpenBSD: sftp.c,v 1.225 2023/01/05 05:49:13 djm Exp $ */ +/* $OpenBSD: sftp.c,v 1.226 2023/02/27 22:12:40 dtucker Exp $ */ /* * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> * @@ -1030,6 +1030,7 @@ do_globbed_ls(struct sftp_conn *conn, const char *path, if (lflag & LS_LONG_VIEW) { if (g.gl_statv[i] == NULL) { error("no stat information for %s", fname); + free(fname); continue; } lname = ls_file(fname, g.gl_statv[i], 1, |