aboutsummaryrefslogtreecommitdiff
path: root/libssh/channels.c
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:26:50 +0100
commit25772145172d28c67fc193440d6ce33747d32203 (patch)
treedfb3702c6bdf71e858406aab108c364b986f9ab4 /libssh/channels.c
parent8e7bd43016393bc36f509ebe914e4d5c91356404 (diff)
downloadlibssh-25772145172d28c67fc193440d6ce33747d32203.tar.gz
libssh-25772145172d28c67fc193440d6ce33747d32203.tar.xz
libssh-25772145172d28c67fc193440d6ce33747d32203.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>
Diffstat (limited to 'libssh/channels.c')
-rw-r--r--libssh/channels.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libssh/channels.c b/libssh/channels.c
index 2731843..c10369e 100644
--- a/libssh/channels.c
+++ b/libssh/channels.c
@@ -1458,6 +1458,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;
@@ -1472,7 +1473,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;
}