]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix MODAPP-134
authorBrian West <brian@freeswitch.org>
Tue, 2 Sep 2008 14:50:03 +0000 (14:50 +0000)
committerBrian West <brian@freeswitch.org>
Tue, 2 Sep 2008 14:50:03 +0000 (14:50 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9404 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_limit/mod_limit.c

index 06bc7b13a6fd30dc7a2640acf267c1bab65cdd17..bc477b875131191cf9c471eb54da397204c4e95a 100644 (file)
@@ -80,7 +80,9 @@ static switch_status_t limit_execute_sql(char *sql, switch_mutex_t *mutex)
                if (switch_odbc_handle_exec(globals.master_odbc, sql, &stmt) != SWITCH_ODBC_SUCCESS) {
                        char *err_str;
                        err_str = switch_odbc_handle_get_error(globals.master_odbc, stmt);
-                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ERR: [%s]\n[%s]\n", sql, switch_str_nil(err_str));
+                       if ( err_str && strlen(err_str) ) {
+                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ERR: [%s]\n[%s]\n", sql, switch_str_nil(err_str));
+                       }
                        switch_safe_free(err_str);
                        status = SWITCH_STATUS_FALSE;
                }