Explorar el Código

dispatcher: free dset root structure at reload

- reported by Heenan, Timothy Steven
Daniel-Constantin Mierla hace 11 años
padre
commit
7fb8c88c1d
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      modules/dispatcher/dispatch.c

+ 4 - 1
modules/dispatcher/dispatch.c

@@ -846,12 +846,14 @@ int ds_destroy_list(void)
 void destroy_list(int list_id)
 {
 	ds_set_t  *sp = NULL;
+	ds_set_t  *sp1 = NULL;
 	ds_dest_t *dest = NULL;
 
 	sp = ds_lists[list_id];
 
 	while(sp)
 	{
+		sp1 = sp->next;
 		for(dest = sp->dlist; dest!= NULL; dest=dest->next)
 		{
 			if(dest->uri.s!=NULL)
@@ -862,7 +864,8 @@ void destroy_list(int list_id)
 		}
 		if (sp->dlist != NULL)
 			shm_free(sp->dlist);
-		sp = sp->next;
+		shm_free(sp);
+		sp = sp1;
 	}
 
 	ds_lists[list_id]  = NULL;