]> arthur.barton.de Git - ngircd-alex.git/commitdiff
Clean up channel allocation table on shutdown/restart.
authorAlexander Barton <alex@barton.de>
Mon, 5 Jan 2009 11:58:37 +0000 (12:58 +0100)
committerAlexander Barton <alex@barton.de>
Mon, 5 Jan 2009 11:58:37 +0000 (12:58 +0100)
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!

src/ngircd/channel.c

index ba5e72516fb0f4e41cc46837e2a54a87d61836d9..9a59712ade71a4f986aec3a2d8cdd2cabba67c44 100644 (file)
@@ -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 */