[sr-dev] git:master: dispatcher: free dset root structure at reload

Daniel-Constantin Mierla miconda at gmail.com
Thu Sep 11 22:41:11 CEST 2014


Module: sip-router
Branch: master
Commit: 7fb8c88c1d4aeb50d1e637697132ab0994dcdb28
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=7fb8c88c1d4aeb50d1e637697132ab0994dcdb28

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Thu Sep 11 22:36:56 2014 +0200

dispatcher: free dset root structure at reload

- reported by Heenan, Timothy Steven

---

 modules/dispatcher/dispatch.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/modules/dispatcher/dispatch.c b/modules/dispatcher/dispatch.c
index 5538c94..aa8194f 100644
--- a/modules/dispatcher/dispatch.c
+++ b/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;




More information about the sr-dev mailing list