summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--sftp-client.c9
2 files changed, 8 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index a8846d47a..da9306531 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -67,6 +67,9 @@
67 [sftp-client.c] 67 [sftp-client.c]
68 fix leaks in do_hardlink() and do_readlink(); bz#1921 68 fix leaks in do_hardlink() and do_readlink(); bz#1921
69 from Loganaden Velvindron 69 from Loganaden Velvindron
70 - markus@cvs.openbsd.org 2011/09/12 08:46:15
71 [sftp-client.c]
72 fix leak in do_lsreaddir(); ok djm
70 73
7120110909 7420110909
72 - (dtucker) [entropy.h] Bug #1932: remove old definition of init_rng. From 75 - (dtucker) [entropy.h] Bug #1932: remove old definition of init_rng. From
diff --git a/sftp-client.c b/sftp-client.c
index b6d402143..d7eff70b4 100644
--- a/sftp-client.c
+++ b/sftp-client.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sftp-client.c,v 1.95 2011/09/11 16:07:26 markus Exp $ */ 1/* $OpenBSD: sftp-client.c,v 1.96 2011/09/12 08:46:15 markus Exp $ */
2/* 2/*
3 * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> 3 * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
4 * 4 *
@@ -462,12 +462,12 @@ do_lsreaddir(struct sftp_conn *conn, char *path, int printflag,
462 buffer_put_cstring(&msg, path); 462 buffer_put_cstring(&msg, path);
463 send_msg(conn, &msg); 463 send_msg(conn, &msg);
464 464
465 buffer_clear(&msg);
466
467 handle = get_handle(conn, id, &handle_len, 465 handle = get_handle(conn, id, &handle_len,
468 "remote readdir(\"%s\")", path); 466 "remote readdir(\"%s\")", path);
469 if (handle == NULL) 467 if (handle == NULL) {
468 buffer_free(&msg);
470 return -1; 469 return -1;
470 }
471 471
472 if (dir) { 472 if (dir) {
473 ents = 0; 473 ents = 0;
@@ -510,6 +510,7 @@ do_lsreaddir(struct sftp_conn *conn, char *path, int printflag,
510 fx2txt(status)); 510 fx2txt(status));
511 do_close(conn, handle, handle_len); 511 do_close(conn, handle, handle_len);
512 xfree(handle); 512 xfree(handle);
513 buffer_free(&msg);
513 return(status); 514 return(status);
514 } 515 }
515 } else if (type != SSH2_FXP_NAME) 516 } else if (type != SSH2_FXP_NAME)