- markus@cvs.openbsd.org 2011/09/12 08:46:15
[sftp-client.c]
fix leak in do_lsreaddir(); ok djm
diff --git a/ChangeLog b/ChangeLog
index a8846d4..da93065 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -67,6 +67,9 @@
[sftp-client.c]
fix leaks in do_hardlink() and do_readlink(); bz#1921
from Loganaden Velvindron
+ - markus@cvs.openbsd.org 2011/09/12 08:46:15
+ [sftp-client.c]
+ fix leak in do_lsreaddir(); ok djm
20110909
- (dtucker) [entropy.h] Bug #1932: remove old definition of init_rng. From
diff --git a/sftp-client.c b/sftp-client.c
index b6d4021..d7eff70 100644
--- a/sftp-client.c
+++ b/sftp-client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp-client.c,v 1.95 2011/09/11 16:07:26 markus Exp $ */
+/* $OpenBSD: sftp-client.c,v 1.96 2011/09/12 08:46:15 markus Exp $ */
/*
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
*
@@ -462,12 +462,12 @@
buffer_put_cstring(&msg, path);
send_msg(conn, &msg);
- buffer_clear(&msg);
-
handle = get_handle(conn, id, &handle_len,
"remote readdir(\"%s\")", path);
- if (handle == NULL)
+ if (handle == NULL) {
+ buffer_free(&msg);
return -1;
+ }
if (dir) {
ents = 0;
@@ -510,6 +510,7 @@
fx2txt(status));
do_close(conn, handle, handle_len);
xfree(handle);
+ buffer_free(&msg);
return(status);
}
} else if (type != SSH2_FXP_NAME)