From ad693eebcbdf5d038569bdc889f32a699622f2d0 Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Sun, 28 May 2006 18:08:48 +0000 Subject: [PATCH] - Fixed crash in /STATS Z (possibly rare), reported by yasinbey (#0002929). --- Changes | 1 + src/modules/m_stats.c | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Changes b/Changes index 26ca0c141..7f108250d 100644 --- a/Changes +++ b/Changes @@ -1215,3 +1215,4 @@ (#0002921). - Fixed win32 compile problem cause by timesynch. - Updated release notes: more modulization and real command alias support. +- Fixed crash in /STATS Z (possibly rare), reported by yasinbey (#0002929). diff --git a/src/modules/m_stats.c b/src/modules/m_stats.c index cca331180..117dc61ca 100644 --- a/src/modules/m_stats.c +++ b/src/modules/m_stats.c @@ -987,10 +987,8 @@ int stats_mem(aClient *sptr, char *para) sendto_one(sptr, ":%s %d %s :Dbuf blocks %d(%ld)", me.name, RPL_STATSDEBUG, sptr->name, dbufblocks, db); - link = freelink; - while ((link = link->next)) + for (link = freelink; link; link = link->next) fl++; - fl++; sendto_one(sptr, ":%s %d %s :Link blocks free %d(%ld) total %d(%ld)", me.name, RPL_STATSDEBUG, sptr->name, fl, (long)(fl * sizeof(Link)),