aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVic Lee <llyzs@163.com>2010-02-01 23:26:10 +0800
committerAndreas Schneider <mail@cynapses.org>2010-02-01 17:24:50 +0100
commit474d63f24e396e82316f316b07bfe04cf43a5a60 (patch)
tree521ca88a944ba174b4f9d7778fc8921995746d52
parentb3589fbf6c25480c937e6a9f330afd7af2a91fe7 (diff)
downloadlibssh-474d63f24e396e82316f316b07bfe04cf43a5a60.tar.gz
libssh-474d63f24e396e82316f316b07bfe04cf43a5a60.tar.xz
libssh-474d63f24e396e82316f316b07bfe04cf43a5a60.zip
The ssh_message object needs to be freed after processing in channel_accept().
Signed-off-by: Vic Lee <llyzs@163.com> Signed-off-by: Andreas Schneider <mail@cynapses.org>
-rw-r--r--libssh/channels.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libssh/channels.c b/libssh/channels.c
index 13ea25f2..a046e89f 100644
--- a/libssh/channels.c
+++ b/libssh/channels.c
@@ -1359,6 +1359,7 @@ static ssh_channel channel_accept(ssh_session session, int channeltype,
};
#endif
ssh_message msg = NULL;
+ ssh_channel channel = NULL;
struct ssh_iterator *iterator;
int t;
@@ -1373,7 +1374,9 @@ static ssh_channel channel_accept(ssh_session session, int channeltype,
if (ssh_message_type(msg) == SSH_REQUEST_CHANNEL_OPEN &&
ssh_message_subtype(msg) == channeltype) {
ssh_list_remove(session->ssh_message_list, iterator);
- return ssh_message_channel_request_open_reply_accept(msg);
+ channel = ssh_message_channel_request_open_reply_accept(msg);
+ ssh_message_free(msg);
+ return channel;
}
iterator = iterator->next;
}