diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index 1f2afef85c..c00c439600 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -3454,17 +3454,15 @@ char *sofia_glue_get_host(const char *str, switch_memory_pool_t *pool) { char *s, *p; + switch_assert(pool != NULL); + if ((p = strchr(str, '@'))) { p++; } else { return NULL; } - if (pool) { - s = switch_core_strdup(pool, p); - } else { - s = strdup(p); - } + s = switch_core_strdup(pool, p); for (p = s; p && *p; p++) { if ((*p == ';') || (*p == '>')) {