diff -u a/dispatch.c b/dispatch.c --- a/dispatch.c 2011-09-07 09:47:13.000000000 +0100 +++ b/dispatch.c 2011-09-07 09:56:27.000000000 +0100 @@ -323,7 +323,6 @@ 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 @@ dest->uri.s = NULL; } } - shm_free(sp->dlist); + if (sp->dlist != NULL) + shm_free(sp->dlist); sp = sp->next; }