[mod_sofia] Cleanup sofia_glue_get_host() and make the pool arg be required.

This commit is contained in:
Andrey Volk 2021-04-06 20:00:13 +03:00
parent f21da2885b
commit 0b0f5fff65
1 changed files with 3 additions and 5 deletions

View File

@ -3454,17 +3454,15 @@ char *sofia_glue_get_host(const char *str, switch_memory_pool_t *pool)
{ {
char *s, *p; char *s, *p;
switch_assert(pool != NULL);
if ((p = strchr(str, '@'))) { if ((p = strchr(str, '@'))) {
p++; p++;
} else { } else {
return NULL; return NULL;
} }
if (pool) { s = switch_core_strdup(pool, p);
s = switch_core_strdup(pool, p);
} else {
s = strdup(p);
}
for (p = s; p && *p; p++) { for (p = s; p && *p; p++) {
if ((*p == ';') || (*p == '>')) { if ((*p == ';') || (*p == '>')) {