summaryrefslogtreecommitdiff
path: root/scp.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2006-06-13 13:00:25 +1000
committerDamien Miller <djm@mindrot.org>2006-06-13 13:00:25 +1000
commit40b5985fe0b2b8e0b78d7bf7f19bcab6018f0a64 (patch)
tree13438d41f0b7d92461ba2cecb520865245383052 /scp.c
parent24fd8ddd61bbbb4d1a5accb9b8bf640904e12be5 (diff)
downloadopenssh-git-40b5985fe0b2b8e0b78d7bf7f19bcab6018f0a64.tar.gz
- markus@cvs.openbsd.org 2006/05/17 12:43:34
[scp.c sftp.c ssh-agent.c ssh-keygen.c sshconnect.c] fix leak; coverity via Kylene Jo Hall
Diffstat (limited to 'scp.c')
-rw-r--r--scp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/scp.c b/scp.c
index 2778f8f8..e5332972 100644
--- a/scp.c
+++ b/scp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scp.c,v 1.141 2006/04/01 05:50:29 djm Exp $ */
+/* $OpenBSD: scp.c,v 1.142 2006/05/17 12:43:34 markus Exp $ */
/*
* scp - secure remote copy. This is basically patched BSD rcp which
* uses ssh to do the data transfer (instead of using rcmd).
@@ -193,7 +193,8 @@ do_cmd(char *host, char *remuser, char *cmd, int *fdin, int *fdout)
* Reserve two descriptors so that the real pipes won't get
* descriptors 0 and 1 because that will screw up dup2 below.
*/
- pipe(reserved);
+ if (pipe(reserved) < 0)
+ fatal("pipe: %s", strerror(errno));
/* Create a socket pair for communicating with ssh. */
if (pipe(pin) < 0)
@@ -499,6 +500,7 @@ toremote(char *targ, int argc, char **argv)
source(1, argv + i);
}
}
+ xfree(arg);
}
void