From e0b90a676696c6729467837f6f4030d18999aa34 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Sun, 26 Mar 2006 13:51:44 +1100 Subject: [PATCH] - djm@cvs.openbsd.org 2006/03/19 02:22:56 [sftp.c] more memory leaks detected by Coverity via elad AT netbsd.org; deraadt@ ok --- ChangeLog | 6 +++++- sftp.c | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0ceea0717..c2d2a365a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,10 @@ [serverloop.c] memory leaks detected by Coverity via elad AT netbsd.org; ok deraadt@ dtucker@ + - djm@cvs.openbsd.org 2006/03/19 02:22:56 + [sftp.c] + more memory leaks detected by Coverity via elad AT netbsd.org; + deraadt@ ok 20060325 - OpenBSD CVS Sync @@ -4275,4 +4279,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4246 2006/03/26 02:51:08 djm Exp $ +$Id: ChangeLog,v 1.4247 2006/03/26 02:51:44 djm Exp $ diff --git a/sftp.c b/sftp.c index d676a3771..194d22710 100644 --- a/sftp.c +++ b/sftp.c @@ -1289,6 +1289,7 @@ interactive_loop(int fd_in, int fd_out, char *file1, char *file2) if (parse_dispatch_command(conn, cmd, &pwd, 1) != 0) { xfree(dir); xfree(pwd); + xfree(conn); return (-1); } } else { @@ -1301,6 +1302,7 @@ interactive_loop(int fd_in, int fd_out, char *file1, char *file2) err = parse_dispatch_command(conn, cmd, &pwd, 1); xfree(dir); xfree(pwd); + xfree(conn); return (err); } xfree(dir); @@ -1365,6 +1367,7 @@ interactive_loop(int fd_in, int fd_out, char *file1, char *file2) break; } xfree(pwd); + xfree(conn); #ifdef USE_LIBEDIT if (el != NULL)