comparison common-channel.c @ 944:2e402a09e21e

Avoid use-after-free when channel inithandler fails. Thanks to Coverity
author Matt Johnston <matt@ucc.asn.au>
date Sat, 26 Jul 2014 10:18:55 +0800
parents 5daedffd0769
children 36eacc322e00
comparison
equal deleted inserted replaced
942:8664fea5072f 944:2e402a09e21e
1087 if (channel->type->inithandler) { 1087 if (channel->type->inithandler) {
1088 ret = channel->type->inithandler(channel); 1088 ret = channel->type->inithandler(channel);
1089 if (ret > 0) { 1089 if (ret > 0) {
1090 remove_channel(channel); 1090 remove_channel(channel);
1091 TRACE(("inithandler returned failure %d", ret)) 1091 TRACE(("inithandler returned failure %d", ret))
1092 return;
1092 } 1093 }
1093 } 1094 }
1094 1095
1095 if (channel->prio == DROPBEAR_CHANNEL_PRIO_EARLY) { 1096 if (channel->prio == DROPBEAR_CHANNEL_PRIO_EARLY) {
1096 channel->prio = DROPBEAR_CHANNEL_PRIO_BULK; 1097 channel->prio = DROPBEAR_CHANNEL_PRIO_BULK;