aboutsummaryrefslogtreecommitdiff
path: root/libssh
diff options
context:
space:
mode:
Diffstat (limited to 'libssh')
-rw-r--r--libssh/channels.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libssh/channels.c b/libssh/channels.c
index 2731843c..c10369ee 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;
}