summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/motd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/motd.c b/src/motd.c
index 21218e3..138b9b3 100644
--- a/src/motd.c
+++ b/src/motd.c
@@ -210,7 +210,6 @@ motd_destroy(struct Motd *motd)
if (motd->cache) /* drop the cache */
motd_decache(motd);
- dlinkDelete(&motd->node, &MotdList.other);
MyFree(motd->path); /* we always must have a path */
MyFree(motd->hostmask);
MyFree(motd);
@@ -411,7 +410,10 @@ motd_clear(void)
motd_decache(MotdList.remote);
DLINK_FOREACH_SAFE(ptr, ptr_next, MotdList.other.head) /* destroy other MOTDs */
+ {
+ dlinkDelete(ptr, &MotdList.other);
motd_destroy(ptr->data);
+ }
/* now recache local and remote MOTDs */
motd_cache(MotdList.local);