]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
MODAPP-346 - segfault on no dsn
authorRupa Schomaker <rupa@rupa.com>
Wed, 30 Sep 2009 12:25:28 +0000 (12:25 +0000)
committerRupa Schomaker <rupa@rupa.com>
Wed, 30 Sep 2009 12:25:28 +0000 (12:25 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15019 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_cidlookup/mod_cidlookup.c

index 59fc59b0b332599ec4af91aaa486c6e804f48c11..892a1892760651a67b42860ead9e839290f2f1eb 100755 (executable)
@@ -95,11 +95,11 @@ static switch_status_t config_callback_dsn(switch_xml_config_item_t *data, const
        }
        
        if ((callback_type == CONFIG_LOAD || callback_type == CONFIG_RELOAD) && changed) {
-               odbc_dsn = strdup(newvalue);
 
-               if(switch_strlen_zero(odbc_dsn)) {
+               if(switch_strlen_zero(newvalue)) {
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "No local database defined.\n");
                } else {
+                       odbc_dsn = strdup(newvalue);
                        if ((odbc_user = strchr(odbc_dsn, ':'))) {
                                *odbc_user++ = '\0';
                                if ((odbc_pass = strchr(odbc_user, ':'))) {