* ircd/IPcheck.c: Add Debug()s to try to track why the connected
count underflows.
+ * ircd/m_endburst.c (ms_endofburst): Avoid dereferencing 'chan'
+ after it may be freed (in sub1_from_channel).
+
2005-05-12 Michael Poole <mdpoole@troilus.org>
* configure.in: Do not try to outsmart the default CFLAGS.
/* Count through channels... */
for (chan = GlobalChannelList; chan; chan = next_chan) {
next_chan = chan->next;
-
- if (!chan->members) { /* empty channel */
- if ((chan->mode.mode & MODE_BURSTADDED))
- sub1_from_channel(chan); /* New empty channel, schedule it for removal. */
- }
-
- chan->mode.mode &= ~MODE_BURSTADDED;
+ if (!chan->members && (chan->mode.mode & MODE_BURSTADDED)) {
+ /* Newly empty channel, schedule it for removal. */
+ chan->mode.mode &= ~MODE_BURSTADDED;
+ sub1_from_channel(chan);
+ } else
+ chan->mode.mode &= ~MODE_BURSTADDED;
}
return 0;