[Freeswitch-svn] [commit] r10891 - freeswitch/trunk/src/mod/applications/mod_limit
FreeSWITCH SVN
mrene at freeswitch.org
Fri Dec 19 18:14:12 PST 2008
Author: mrene
Date: Fri Dec 19 21:14:10 2008
New Revision: 10891
Log:
Fix leak and remove extra \n
Modified:
freeswitch/trunk/src/mod/applications/mod_limit/mod_limit.c
Modified: freeswitch/trunk/src/mod/applications/mod_limit/mod_limit.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_limit/mod_limit.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_limit/mod_limit.c Fri Dec 19 21:14:10 2008
@@ -240,17 +240,17 @@
switch_core_db_test_reactive(db, "select * from limit_data", NULL, limit_sql);
switch_core_db_test_reactive(db, "select * from db_data", NULL, db_sql);
switch_core_db_test_reactive(db, "select * from group_data", NULL, group_sql);
-
- switch_core_db_exec(db, "create index if not exists ld_hostname on limit_data (hostname)", NULL, NULL, NULL);
- switch_core_db_exec(db, "create index if not exists ld_uuid on limit_data (uuid)", NULL, NULL, NULL);
- switch_core_db_exec(db, "create index if not exists ld_realm on limit_data (realm)", NULL, NULL, NULL);
- switch_core_db_exec(db, "create index if not exists ld_id on limit_data (id)", NULL, NULL, NULL);
-
- switch_core_db_exec(db, "create index if not exists dd_realm on db_data (realm)", NULL, NULL, NULL);
- switch_core_db_exec(db, "create index if not exists dd_data_key on db_data (data_key)", NULL, NULL, NULL);
-
- switch_core_db_exec(db, "create index if not exists gd_groupname on group_data (groupname)", NULL, NULL, NULL);
- switch_core_db_exec(db, "create index if not exists gd_url on group_data (url)", NULL, NULL, NULL);
+
+ switch_core_db_exec(db, "create index if not exists ld_hostname on limit_data (hostname)", NULL, NULL, NULL);
+ switch_core_db_exec(db, "create index if not exists ld_uuid on limit_data (uuid)", NULL, NULL, NULL);
+ switch_core_db_exec(db, "create index if not exists ld_realm on limit_data (realm)", NULL, NULL, NULL);
+ switch_core_db_exec(db, "create index if not exists ld_id on limit_data (id)", NULL, NULL, NULL);
+
+ switch_core_db_exec(db, "create index if not exists dd_realm on db_data (realm)", NULL, NULL, NULL);
+ switch_core_db_exec(db, "create index if not exists dd_data_key on db_data (data_key)", NULL, NULL, NULL);
+
+ switch_core_db_exec(db, "create index if not exists gd_groupname on group_data (groupname)", NULL, NULL, NULL);
+ switch_core_db_exec(db, "create index if not exists gd_url on group_data (url)", NULL, NULL, NULL);
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Cannot Open SQL Database!\n");
@@ -773,7 +773,7 @@
if (argc < 2) {
stream->write_function(stream, "USAGE: limit_usage %s\n", LIMIT_USAGE_USAGE);
- return SWITCH_STATUS_SUCCESS;
+ goto end;
}
@@ -786,7 +786,10 @@
limit_execute_sql_callback(NULL, sql, sql2str_callback, &cbt);
switch_safe_free(sql);
- stream->write_function(stream, "%s\n", buf);
+ stream->write_function(stream, "%s", buf);
+
+end:
+ switch_safe_free(mydata);
return SWITCH_STATUS_SUCCESS;
}
More information about the Freeswitch-svn
mailing list