]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
mod_callcenter: Fix a potential segv following previous commit
authorMarc Olivier Chouinard <mochouinard@moctel.com>
Sat, 2 Oct 2010 03:35:51 +0000 (23:35 -0400)
committerMarc Olivier Chouinard <mochouinard@moctel.com>
Sat, 2 Oct 2010 03:35:51 +0000 (23:35 -0400)
src/mod/applications/mod_callcenter/mod_callcenter.c

index e06812273207deb376599efe9084949a2ad26e32..ddd2cd5175838b491f2f7daee4f25884c7beafe1 100644 (file)
@@ -1275,6 +1275,9 @@ static switch_status_t load_config(void)
                        }
                }
        }
+       if (!globals.dbname) {
+               globals.dbname = strdup(CC_SQLITE_DB_NAME);
+       }
 
        /* Loading queue into memory struct */
        if ((x_queues = switch_xml_child(cfg, "queues"))) {
@@ -2683,8 +2686,6 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_callcenter_load)
        memset(&globals, 0, sizeof(globals));
        globals.pool = pool;
 
-       globals.dbname = CC_SQLITE_DB_NAME;
-
        switch_core_hash_init(&globals.queue_hash, globals.pool);
        switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, globals.pool);