[Initng-svn] r3696 - initng/trunk/src

svn at initng.thinktux.net svn at initng.thinktux.net
Thu Apr 6 01:50:59 CEST 2006


Author: jimmy
Date: Thu Apr  6 01:50:58 2006
New Revision: 3696

Modified:
   initng/trunk/src/initng_load_module.c
   initng/trunk/src/initng_struct_data.c
Log:
FINALLY!   Fixed the bug, that took me so long to figure out.
Now reloading services, wont segfault initng anymore.



Modified: initng/trunk/src/initng_load_module.c
==============================================================================
--- initng/trunk/src/initng_load_module.c	(original)
+++ initng/trunk/src/initng_load_module.c	Thu Apr  6 01:50:58 2006
@@ -228,7 +228,7 @@
 	/* free module name */
 	if (m->module_name)
 	{
-		printf("Free: %s\n", m->module_name);
+		/*printf("Free: %s\n", m->module_name);*/
 		free(m->module_name);
 		m->module_name = NULL;
 	}

Modified: initng/trunk/src/initng_struct_data.c
==============================================================================
--- initng/trunk/src/initng_struct_data.c	(original)
+++ initng/trunk/src/initng_struct_data.c	Thu Apr  6 01:50:58 2006
@@ -407,6 +407,9 @@
 	assert(current);
 	assert(current->type);
 
+	/* Unlink this entry from any list */
+	list_del(&current->list);
+
 	/* free variable data */
 	switch (current->type->opt_type)
 	{
@@ -435,7 +438,6 @@
 void d_dfree_var(s_entry * type, const char *vn, data_head * d)
 {
 	s_data *current;
-	s_data *s = NULL;
 
 	assert(d);
 	assert(type);
@@ -446,9 +448,9 @@
 		return;
 	}
 
-	while ((current = d_get_next_var(type, vn, d, s)))
+	/* for every matching, free it */
+	while ((current = d_get_next_var(type, vn, d, NULL)))
 	{
-		s = current;
 		d_dfree(current);
 	}
 }
@@ -466,7 +468,6 @@
 	list_for_each_entry_safe(current, s, &d->head.list, list)
 	{
 		/* walk, and remove all */
-		list_del(&current->list);
 		d_dfree(current);
 		current = NULL;
 	}


More information about the Initng-svn mailing list