aboutsummaryrefslogtreecommitdiff
path: root/src/channels.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2018-12-12 18:30:26 +0100
committerAndreas Schneider <asn@cryptomilk.org>2018-12-12 18:31:31 +0100
commit6cd8d4a24aa067d16611eb64bf306b7853748f34 (patch)
tree44856b661b3b34418ec28404e383f1b2cac0923f /src/channels.c
parent0bd404bcbd7c3e9e8d5ed58fcb69b95bf7b91e07 (diff)
downloadlibssh-6cd8d4a24aa067d16611eb64bf306b7853748f34.tar.gz
libssh-6cd8d4a24aa067d16611eb64bf306b7853748f34.tar.xz
libssh-6cd8d4a24aa067d16611eb64bf306b7853748f34.zip
channels: Don't call ssh_channel_close() twice
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src/channels.c')
-rw-r--r--src/channels.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/channels.c b/src/channels.c
index 6789d9da..d339f732 100644
--- a/src/channels.c
+++ b/src/channels.c
@@ -1168,6 +1168,11 @@ int ssh_channel_close(ssh_channel channel)
return SSH_ERROR;
}
+ /* If the channel close has already been sent we're done here. */
+ if (channel->flags & SSH_CHANNEL_FLAG_CLOSED_LOCAL) {
+ return SSH_OK;
+ }
+
session = channel->session;
if (channel->local_eof == 0) {