From: Michael Poole Date: Fri, 14 May 2004 12:50:32 +0000 (+0000) Subject: Fix memory counting bugs for jupes and glines. X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=6abce334b16cc83205d6136d5f0267501d7fa38d Fix memory counting bugs for jupes and glines. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1045 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- diff --git a/ChangeLog b/ChangeLog index 3990421..eebf019 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-05-14 Matthias Crauwels + + [Original ChangeLog date: 2003-06-08 -MP] + + * ircd/gline.c: fixed the counting bug in gline_memory_count + + * ircd/jupe.c: fixed the counting bug in jupe_memory_count + 2004-05-14 Michael Poole * ircd/m_mode.c (ms_mode): Do not always try to call diff --git a/ircd/gline.c b/ircd/gline.c index 23a254f..dd85368 100644 --- a/ircd/gline.c +++ b/ircd/gline.c @@ -753,10 +753,10 @@ gline_memory_count(size_t *gl_size) for (gline = GlobalGlineList; gline; gline = gline->gl_next) { gl++; - gl_size += sizeof(struct Gline); - gl_size += gline->gl_user ? (strlen(gline->gl_user) + 1) : 0; - gl_size += gline->gl_host ? (strlen(gline->gl_host) + 1) : 0; - gl_size += gline->gl_reason ? (strlen(gline->gl_reason) + 1) : 0; + *gl_size += sizeof(struct Gline); + *gl_size += gline->gl_user ? (strlen(gline->gl_user) + 1) : 0; + *gl_size += gline->gl_host ? (strlen(gline->gl_host) + 1) : 0; + *gl_size += gline->gl_reason ? (strlen(gline->gl_reason) + 1) : 0; } return gl; } diff --git a/ircd/jupe.c b/ircd/jupe.c index e76455b..e54d060 100644 --- a/ircd/jupe.c +++ b/ircd/jupe.c @@ -341,9 +341,9 @@ jupe_memory_count(size_t *ju_size) for (jupe = GlobalJupeList; jupe; jupe = jupe->ju_next) { ju++; - ju_size += sizeof(struct Jupe); - ju_size += jupe->ju_server ? (strlen(jupe->ju_server) + 1) : 0; - ju_size += jupe->ju_reason ? (strlen(jupe->ju_reason) + 1) : 0; + *ju_size += sizeof(struct Jupe); + *ju_size += jupe->ju_server ? (strlen(jupe->ju_server) + 1) : 0; + *ju_size += jupe->ju_reason ? (strlen(jupe->ju_reason) + 1) : 0; } return ju; }