Currently, AFKMud's free_channels (and possibly other functions similar to it) are doing something naughty by deleting a list member while using an iterator. This can lead to the iterator becoming corrupted, and the whole thing just fails to do what it was intended to do. The easiest way to fix it is to do something like this:
void free_channels( void )
while( chanlist.empty( ) == false )
channel = *( chanlist.begin( ) );
chanlist.remove( channel );
This prevents the iterator from becoming corrupted, because there isn't one, and still removes every list member from the game and memory, as was intended.
[Edit:] Btw, that code is pulled from SW:TSW which uses AFKMud's channel code, so the define for channel may be different if you're using AFKMud. >.>