- (dtucker) OpenBSD CVS Sync
- markus@cvs.openbsd.org 2004/11/25 22:22:14
[sftp-client.c sftp.c]
leak; from mpech
diff --git a/ChangeLog b/ChangeLog
index 11f7bbd..f80f685 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
20041206
- (dtucker) [TODO WARNING.RNG] Update to reflect current reality. ok djm@
+ - (dtucker) OpenBSD CVS Sync
+ - markus@cvs.openbsd.org 2004/11/25 22:22:14
+ [sftp-client.c sftp.c]
+ leak; from mpech
20041203
- (dtucker) OpenBSD CVS Sync
@@ -1873,4 +1877,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.3585 2004/12/06 11:40:10 dtucker Exp $
+$Id: ChangeLog,v 1.3586 2004/12/06 11:43:43 dtucker Exp $
diff --git a/sftp-client.c b/sftp-client.c
index 0ffacbc..d894a11 100644
--- a/sftp-client.c
+++ b/sftp-client.c
@@ -20,7 +20,7 @@
/* XXX: copy between two remote sites */
#include "includes.h"
-RCSID("$OpenBSD: sftp-client.c,v 1.51 2004/07/11 17:48:47 deraadt Exp $");
+RCSID("$OpenBSD: sftp-client.c,v 1.52 2004/11/25 22:22:14 markus Exp $");
#include "openbsd-compat/sys-queue.h"
@@ -172,6 +172,7 @@
int status = buffer_get_int(&msg);
error("Couldn't get handle: %s", fx2txt(status));
+ buffer_free(&msg);
return(NULL);
} else if (type != SSH2_FXP_HANDLE)
fatal("Expected SSH2_FXP_HANDLE(%u) packet, got %u",
@@ -206,6 +207,7 @@
debug("Couldn't stat remote file: %s", fx2txt(status));
else
error("Couldn't stat remote file: %s", fx2txt(status));
+ buffer_free(&msg);
return(NULL);
} else if (type != SSH2_FXP_ATTRS) {
fatal("Expected SSH2_FXP_ATTRS(%u) packet, got %u",
diff --git a/sftp.c b/sftp.c
index 2db394e..b37c36b 100644
--- a/sftp.c
+++ b/sftp.c
@@ -16,7 +16,7 @@
#include "includes.h"
-RCSID("$OpenBSD: sftp.c,v 1.57 2004/11/05 12:19:56 djm Exp $");
+RCSID("$OpenBSD: sftp.c,v 1.58 2004/11/25 22:22:14 markus Exp $");
#ifdef USE_LIBEDIT
#include <histedit.h>
@@ -1265,8 +1265,11 @@
if (remote_is_dir(conn, dir) && file2 == NULL) {
printf("Changing to: %s\n", dir);
snprintf(cmd, sizeof cmd, "cd \"%s\"", dir);
- if (parse_dispatch_command(conn, cmd, &pwd, 1) != 0)
+ if (parse_dispatch_command(conn, cmd, &pwd, 1) != 0) {
+ xfree(dir);
+ xfree(pwd);
return (-1);
+ }
} else {
if (file2 == NULL)
snprintf(cmd, sizeof cmd, "get %s", dir);