]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_sofia] Cleanup sofia_glue_get_host() and make the pool arg be required.
authorAndrey Volk <andywolk@gmail.com>
Tue, 6 Apr 2021 17:00:13 +0000 (20:00 +0300)
committerAndrey Volk <andywolk@gmail.com>
Tue, 19 Oct 2021 17:39:35 +0000 (20:39 +0300)
src/mod/endpoints/mod_sofia/sofia_glue.c

index 1f2afef85ca6085a935ec58cc6f5ab57cbc62768..c00c4396003aca0b5c8963556ef51b852ccbe61e 100644 (file)
@@ -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 == '>')) {