Module: sip-router
Branch: 3.1
Commit: 66e3531def2e011aa640033a161c9a2fd6e4578c
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=66e3531def2e011aa640033a161c9a2fd6e4578c

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date:   Wed Sep  7 13:23:07 2011 +0200

dispatcher(k): fix segfault if dispatcher cannot resolve hostnames

- applies if the dispatcher module cannot resolve hostnames during
  startup (and tries to shutdown)
- patch by Hugh Waite
(cherry picked from commit cad2daebf295443f2318abbb608102bb99111948)

---

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

diff --git a/modules_k/dispatcher/dispatch.c b/modules_k/dispatcher/dispatch.c
index ba123bb..79bcc57 100644
--- a/modules_k/dispatcher/dispatch.c
+++ b/modules_k/dispatcher/dispatch.c
@@ -349,7 +349,6 @@ int add_dest2list(int id, str uri, int flags, int priority, 
str *attrs,
        if (he==0)
        {
                LM_ERR("could not resolve %.*s\n", puri.host.len, puri.host.s);
-               pkg_free(hn);
                goto err;
        }
        /* Free the hostname */
@@ -841,7 +840,8 @@ void destroy_list(int list_id)
                                dest->uri.s = NULL;
                        }
                }
-               shm_free(sp->dlist);
+               if (sp->dlist != NULL)
+                       shm_free(sp->dlist);
                sp = sp->next;
        }
        


_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to