summaryrefslogtreecommitdiff
path: root/scp.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2003-03-10 11:21:17 +1100
committerDamien Miller <djm@mindrot.org>2003-03-10 11:21:17 +1100
commit0011138d47e284273ba77415f7162aaab60d9a44 (patch)
treec175bfc5d470a641dfc727490eec5765903992d2 /scp.c
parent73942b9d54ec71ae76e58d5bf3b06f094bfc3002 (diff)
- (djm) OpenBSD CVS Sync
- markus@cvs.openbsd.org 2003/03/05 22:33:43 [channels.c monitor.c scp.c session.c sftp-client.c sftp-int.c] [sftp-server.c ssh-add.c sshconnect2.c] fix memory leaks; from dlheine@suif.Stanford.EDU/CLOUSEAU; ok djm@
Diffstat (limited to 'scp.c')
-rw-r--r--scp.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/scp.c b/scp.c
index e44a1cf6..ab67c0bb 100644
--- a/scp.c
+++ b/scp.c
@@ -75,7 +75,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: scp.c,v 1.101 2003/02/02 10:51:13 markus Exp $");
+RCSID("$OpenBSD: scp.c,v 1.102 2003/03/05 22:33:43 markus Exp $");
#include "xmalloc.h"
#include "atomicio.h"
@@ -395,10 +395,14 @@ toremote(targ, argc, argv)
suser = argv[i];
if (*suser == '\0')
suser = pwd->pw_name;
- else if (!okname(suser))
+ else if (!okname(suser)) {
+ xfree(bp);
continue;
- if (tuser && !okname(tuser))
+ }
+ if (tuser && !okname(tuser)) {
+ xfree(bp);
continue;
+ }
snprintf(bp, len,
"%s%s %s -n "
"-l %s %s %s %s '%s%s%s:%s'",