[cvslog] (2006-01-06 00:53:21 UTC) Module eggdrop1.9: Change committed!

cvslog cvs at tsss.org
Thu Jan 5 18:53:21 CST 2006


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.9
Commit time: 2006-01-06 00:53:20 UTC
Commited by: sven

Modified files:
     lib/eggdrop/config.c

Log message:

 * fixed two memory crash bugs on .restart

---------------------- diff included ----------------------
Index: eggdrop1.9/lib/eggdrop/config.c
diff -u eggdrop1.9/lib/eggdrop/config.c:1.10 eggdrop1.9/lib/eggdrop/config.c:1.11
--- eggdrop1.9/lib/eggdrop/config.c:1.10	Sun Oct 17 00:14:06 2004
+++ eggdrop1.9/lib/eggdrop/config.c	Thu Jan  5 18:53:10 2006
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: config.c,v 1.10 2004-10-17 05:14:06 stdarg Exp $";
+static const char rcsid[] = "$Id: config.c,v 1.11 2006-01-06 00:53:10 sven Exp $";
 #endif
 
 #include <eggdrop/eggdrop.h>
@@ -97,8 +97,10 @@
 			if (roots[i].handle) free(roots[i].handle);
 			xml_node_delete_callbacked(roots[i].root, config_delete_var);
 			memmove(roots+i, roots+i+1, sizeof(*roots) * (nroots-i-1));
-			if (--nroots == 0)
+			if (--nroots == 0) {
 				free(roots);
+				roots = NULL;
+			}
 			return (0);	
 		}
 	}
@@ -145,7 +147,7 @@
 	switch (var->type) {
 		case (CONFIG_STRING):
 			free(*(char **)var->ptr);
-			var->ptr = NULL;
+			*(char **) var->ptr = NULL;
 			break;
 		case (CONFIG_INT):
 			break;
----------------------- End of diff -----------------------



More information about the Changes mailing list