]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
mod_fifo: Refactor to avoid a memory allocation
authorTravis Cross <tc@traviscross.com>
Mon, 26 May 2014 19:46:55 +0000 (19:46 +0000)
committerTravis Cross <tc@traviscross.com>
Wed, 28 May 2014 01:32:07 +0000 (01:32 +0000)
src/mod/applications/mod_fifo/mod_fifo.c

index eb4c8c6d0560dc062707a2befe6956f648492421..f1a1474882863e6fabb71b9b77ea7981af2c10eb 100644 (file)
@@ -999,8 +999,6 @@ static fifo_node_t *create_node(const char *name, uint32_t importance, switch_mu
        char outbound_count[80] = "";
        callback_t cbt = { 0 };
        char *sql = NULL;
-       char *domain_name = NULL;
-
        if (!globals.running) {
                return NULL;
        }
@@ -1013,8 +1011,7 @@ static fifo_node_t *create_node(const char *name, uint32_t importance, switch_mu
        node->name = switch_core_strdup(node->pool, name);
 
        if (!strchr(name, '@')) {
-               domain_name = switch_core_get_domain(SWITCH_TRUE);
-               node->domain_name = switch_core_strdup(node->pool, domain_name);
+               node->domain_name = switch_core_strdup(node->pool, switch_core_get_domain(SWITCH_FALSE));
        }
 
        for (x = 0; x < MAX_PRI; x++) {
@@ -1043,8 +1040,6 @@ static fifo_node_t *create_node(const char *name, uint32_t importance, switch_mu
        globals.nodes = node;
        switch_mutex_unlock(globals.mutex);
 
-       switch_safe_free(domain_name);
-
        return node;
 }