Module: sip-router
Branch: master
Commit: cad2daebf295443f2318abbb608102bb99111948
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=cad2daeā¦
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
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
---
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 50df1fc..b4f2ee3 100644
--- a/modules_k/dispatcher/dispatch.c
+++ b/modules_k/dispatcher/dispatch.c
@@ -323,7 +323,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 */
@@ -815,7 +814,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;
}