From 2f1f662d46e077d49c2e89eed018077d1569c215 Mon Sep 17 00:00:00 2001 From: Anderson Toshiyuki Sasaki Date: Tue, 5 Nov 2019 14:14:16 +0100 Subject: [PATCH] channels: Initialize states explicitly In ssh_channel_new(), initialize channel->state and channel->request_state explicitly for better readability. Fixes T194 Signed-off-by: Anderson Toshiyuki Sasaki Reviewed-by: Andreas Schneider --- src/channels.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/channels.c b/src/channels.c index 412dd9ce..19eabef7 100644 --- a/src/channels.c +++ b/src/channels.c @@ -121,6 +121,10 @@ ssh_channel ssh_channel_new(ssh_session session) ssh_list_prepend(session->channels, channel); + /* Set states explicitly */ + channel->state = SSH_CHANNEL_STATE_NOT_OPEN; + channel->request_state = SSH_CHANNEL_REQ_STATE_NONE; + return channel; }