starttime = (long) time(NULL);
#ifdef HAVE_EPOLL
- for (epollo = outgoing; epollo; epollo = epollo->q_next)
- ast_poll_channel_add(in, epollo->chan);
+ for (epollo = outgoing; epollo; epollo = epollo->q_next) {
+ if(epollo->chan)
+ ast_poll_channel_add(in, epollo->chan);
+ }
#endif
while (*to && !peer) {
}
#ifdef HAVE_EPOLL
- for(epollo = outgoing; epollo; epollo = epollo->q_next)
- ast_poll_channel_del(in, epollo->chan);
+ for(epollo = outgoing; epollo; epollo = epollo->q_next) {
+ if(epollo->chan)
+ ast_poll_channel_del(in, epollo->chan);
+ }
#endif
return peer;