channels: Don't call ssh_channel_close() twice

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 6cd8d4a24a)
This commit is contained in:
Andreas Schneider
2018-12-12 18:30:26 +01:00
parent a6e055c42b
commit fded1fb9eb

View File

@@ -1160,6 +1160,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) {