aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-05-05 08:29:16 +0000
committerAndreas Schneider <mail@cynapses.org>2009-05-05 08:29:16 +0000
commitec714ea67d7eacc01dd5a28b01c95858e9a26769 (patch)
tree9087ed205a96f3e2119d44730023844db9a1c5b8
parentde138cd055228a20b84bba4560273a03ed0d6426 (diff)
downloadlibssh-ec714ea67d7eacc01dd5a28b01c95858e9a26769.tar.gz
libssh-ec714ea67d7eacc01dd5a28b01c95858e9a26769.tar.xz
libssh-ec714ea67d7eacc01dd5a28b01c95858e9a26769.zip
Improve channel_request_exec1().
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@733 7dcaeef0-15fb-0310-b436-a5af3365683c
-rw-r--r--libssh/channels1.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/libssh/channels1.c b/libssh/channels1.c
index b749be45..1d360398 100644
--- a/libssh/channels1.c
+++ b/libssh/channels1.c
@@ -190,11 +190,8 @@ int channel_request_exec1(CHANNEL *channel, const char *cmd) {
return -1;
}
- if (buffer_add_u8(session->out_buffer, SSH_CMSG_EXEC_CMD) < 0) {
- string_free(command);
- return -1;
- }
- if (buffer_add_ssh_string(session->out_buffer, command) < 0) {
+ if (buffer_add_u8(session->out_buffer, SSH_CMSG_EXEC_CMD) < 0 ||
+ buffer_add_ssh_string(session->out_buffer, command) < 0) {
string_free(command);
return -1;
}