From 05582389799ddd1358463bbbfb77b6f443f300f0 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sat, 6 Nov 2021 10:13:40 +0000 Subject: Plug a couple of minor mem leaks. From beldmit at gmail.com via github PR#283, ok markus@ --- usr.bin/ssh/sftp-client.c | 3 ++- usr.bin/ssh/sftp-server.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/ssh/sftp-client.c b/usr.bin/ssh/sftp-client.c index 3507a366ecc..754c6a91d25 100644 --- a/usr.bin/ssh/sftp-client.c +++ b/usr.bin/ssh/sftp-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sftp-client.c,v 1.156 2021/10/24 21:24:17 deraadt Exp $ */ +/* $OpenBSD: sftp-client.c,v 1.157 2021/11/06 10:13:39 dtucker Exp $ */ /* * Copyright (c) 2001-2004 Damien Miller * @@ -2170,6 +2170,7 @@ handle_dest_replies(struct sftp_conn *to, const char *to_path, int synchronous, (*nreqsp)--; } debug3_f("done: %u outstanding replies", *nreqsp); + sshbuf_free(msg); } int diff --git a/usr.bin/ssh/sftp-server.c b/usr.bin/ssh/sftp-server.c index a6fdb73fbed..53382fdac07 100644 --- a/usr.bin/ssh/sftp-server.c +++ b/usr.bin/ssh/sftp-server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sftp-server.c,v 1.129 2021/08/09 23:47:44 djm Exp $ */ +/* $OpenBSD: sftp-server.c,v 1.130 2021/11/06 10:13:39 dtucker Exp $ */ /* * Copyright (c) 2000-2004 Markus Friedl. All rights reserved. * @@ -1522,6 +1522,7 @@ process_extended_expand(u_int32_t id) npath = xstrdup(path + 2); free(path); xasprintf(&path, "%s/%s", cwd, npath); + free(npath); } else { /* ~user expansions */ if (tilde_expand(path, pw->pw_uid, &npath) != 0) { -- cgit v1.2.3