diff options
| author | Jon Simons <jon@jonsimons.org> | 2013-12-09 11:24:45 -0800 |
|---|---|---|
| committer | Andreas Schneider <asn@cryptomilk.org> | 2013-12-11 21:03:45 +0100 |
| commit | a633deb9854238a1c0ccd05c516b526f327545e8 (patch) | |
| tree | 41604ac9be994cf54402188045d7d00cbd52d2ae /src | |
| parent | 50b9a182f52c38c877b60b781077d33061a78c7d (diff) | |
channel: fix setting of channel->flags
Fix the setting of 'channel->flags' to use '|='. Before this
change, one bug symptom can be that channels are never fully
free'd via ssh_channel_free, resulting in memory leaks.
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/channels.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/channels.c b/src/channels.c index a9226ddb..a6ac2be9 100644 --- a/src/channels.c +++ b/src/channels.c @@ -177,7 +177,7 @@ SSH_PACKET_CALLBACK(ssh_packet_channel_open_conf){ (long unsigned int) channel->remote_maxpacket); channel->state = SSH_CHANNEL_STATE_OPEN; - channel->flags = channel->flags & ~SSH_CHANNEL_FLAG_NOT_BOUND; + channel->flags &= ~SSH_CHANNEL_FLAG_NOT_BOUND; return SSH_PACKET_USED; } @@ -635,7 +635,7 @@ SSH_PACKET_CALLBACK(channel_rcv_close) { channel, channel->callbacks->userdata); } - channel->flags &= SSH_CHANNEL_FLAG_CLOSED_REMOTE; + channel->flags |= SSH_CHANNEL_FLAG_CLOSED_REMOTE; if(channel->flags & SSH_CHANNEL_FLAG_FREED_LOCAL) ssh_channel_do_free(channel); @@ -1078,7 +1078,7 @@ void ssh_channel_free(ssh_channel channel) { if (session->alive && channel->state == SSH_CHANNEL_STATE_OPEN) { ssh_channel_close(channel); } - channel->flags &= SSH_CHANNEL_FLAG_FREED_LOCAL; + channel->flags |= SSH_CHANNEL_FLAG_FREED_LOCAL; /* The idea behind the flags is the following : it is well possible * that a client closes a channel that stills exists on the server side. |
