From: dtucker Date: Wed, 8 Mar 2023 06:21:32 +0000 (+0000) Subject: Plug mem leak. Coverity CID 405196, ok djm@ X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=8eb132fc6fcd6fc03387cdf74a3d70865529ba44;p=openbsd Plug mem leak. Coverity CID 405196, ok djm@ --- diff --git a/usr.bin/ssh/sftp.c b/usr.bin/ssh/sftp.c index 82005c75866..da772cadcd5 100644 --- a/usr.bin/ssh/sftp.c +++ b/usr.bin/ssh/sftp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sftp.c,v 1.227 2023/03/08 04:43:12 guenther Exp $ */ +/* $OpenBSD: sftp.c,v 1.228 2023/03/08 06:21:32 dtucker Exp $ */ /* * Copyright (c) 2001-2004 Damien Miller * @@ -1969,7 +1969,9 @@ complete_match(EditLine *el, struct sftp_conn *conn, char *remote_path, memset(&g, 0, sizeof(g)); if (remote != LOCAL) { - tmp = make_absolute_pwd_glob(tmp, remote_path); + tmp2 = make_absolute_pwd_glob(tmp, remote_path); + free(tmp); + tmp = tmp2; remote_glob(conn, tmp, GLOB_DOOFFS|GLOB_MARK, NULL, &g); } else glob(tmp, GLOB_DOOFFS|GLOB_MARK, NULL, &g);