summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2009-01-05 12:58:37 +0100
committerAlexander Barton <alex@barton.de>2009-01-05 12:58:37 +0100
commit175f0af979bfdb6dfde1535dd7de6a452cf98e32 (patch)
tree3b3cb5e40b8cafb7aa3128feb4f808d31d89f7f0
parent40a0e9abbe8cfd959dd920f2af32976f1eda1a6a (diff)
downloadngircd-175f0af979bfdb6dfde1535dd7de6a452cf98e32.tar.gz
ngircd-175f0af979bfdb6dfde1535dd7de6a452cf98e32.zip
Clean up channel allocation table on shutdown/restart.
Silly bug: the condition of a while() loop in the Channel_Exit() function
used the wrong variable and therefore got never executed ...

This bug is in the code since the beginning (see commit bb19cfda in 2002);
shame on me!
-rw-r--r--src/ngircd/channel.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/ngircd/channel.c b/src/ngircd/channel.c
index ba5e7251..9a59712a 100644
--- a/src/ngircd/channel.c
+++ b/src/ngircd/channel.c
@@ -1,6 +1,6 @@
 /*
  * ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2008 by Alexander Barton (alex@barton.de)
+ * Copyright (c)2001-2009 Alexander Barton (alex@barton.de)
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -174,10 +174,9 @@ Channel_Exit( void )
 
 	/* Free Channel allocation table */
 	cl2chan = My_Cl2Chan;
-	while( c )
-	{
+	while (cl2chan) {
 		cl2chan_next = cl2chan->next;
-		free( cl2chan );
+		free(cl2chan);
 		cl2chan = cl2chan_next;
 	}
 } /* Channel_Exit */