#ifdef SWITCH_HAVE_ODBC
switch_odbc_handle_disconnect(globals.master_odbc);
#endif
+
+ switch_safe_free(globals.db_username);
+ switch_safe_free(globals.db_password);
+ switch_safe_free(globals.db_dsn);
+ switch_safe_free(globals.default_techprofile);
+ switch_safe_free(globals.default_gateway);
+ switch_safe_free(globals.custom_query);
+
return SWITCH_STATUS_UNLOAD;
}
if (globals.pool) {
switch_core_destroy_memory_pool(&globals.pool);
}
+
+ switch_safe_free(globals.root);
+ switch_safe_free(globals.isn_root);
return SWITCH_STATUS_UNLOAD;
}
#include <fcntl.h>
SWITCH_MODULE_LOAD_FUNCTION(mod_dialplan_directory_load);
-SWITCH_MODULE_DEFINITION(mod_dialplan_directory, mod_dialplan_directory_load, NULL, NULL);
+SWITCH_MODULE_DEFINITION(mod_dialplan_directory, mod_dialplan_directory_load, mod_dialplan_directory_shutdown, NULL);
static struct {
char *directory_name;
}
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_enum_shutdown)
+{
+ switch_safe_free(globals.directory_name);
+ switch_safe_free(globals.host);
+ switch_safe_free(globals.dn);
+ switch_safe_free(globals.pass);
+ switch_safe_free(globals.base);
+}
+
+
SWITCH_MODULE_LOAD_FUNCTION(mod_dialplan_directory_load)
{
switch_dialplan_interface_t *dp_interface;
+ memset(&globals, 0, sizeof(globals));
load_config();
+
/* connect my internal structure to the blank pointer passed to me */
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
SWITCH_ADD_DIALPLAN(dp_interface, "directory", directory_dialplan_hunt);
return SWITCH_STATUS_TERM;
}
-
+ memset(&globals, 0, sizeof(globals));
if ((status = load_config()) != SWITCH_STATUS_SUCCESS) {
return status;
switch_core_codec_destroy(&globals.write_codec);
}
switch_core_hash_destroy(&globals.call_hash);
+
+ switch_safe_free(globals.dialplan);
+ switch_safe_free(globals.cid_name);
+ switch_safe_free(globals.cid_num);
+ switch_safe_free(globals.ring_file);
+ switch_safe_free(globals.hold_file);
+ switch_safe_free(globals.timer_name);
+ switch_safe_free(globals.device_name);
return SWITCH_STATUS_SUCCESS;
}
switch_api_interface_t *api_interface;
module_pool = pool;
+
+ memset(&globals, 0, sizeof(globals));
load_config();
switch_core_hash_destroy(&globals.profile_hash);
+
+ switch_safe_free(globals.dialplan);
+ switch_safe_free(globals.codec_string);
+ switch_safe_free(globals.codec_rates_string);
+
return SWITCH_STATUS_SUCCESS;
}
SWITCH_MODULE_LOAD_FUNCTION(mod_iax_load)
{
+ memset(&globals, 0, sizeof(globals));
+
module_pool = pool;
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
}
switch_yield(20000);
}
+
+ switch_safe_free(globals.dialplan);
+ switch_safe_free(globals.codec_string);
+ switch_safe_free(globals.codec_rates_string);
+ switch_safe_free(globals.ip);
+
return SWITCH_STATUS_SUCCESS;
}
module_pool = pool;
+ memset(&globals, 0, sizeof(globals));
+
load_config();
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
}
switch_yield(20000);
}
+
+ /* Free dynamically allocated strings */
+ switch_safe_free(globals.dialplan);
+ switch_safe_free(globals.codec_string);
+ switch_safe_free(globals.codec_rates_string);
+ switch_safe_free(globals.ip);
+
return SWITCH_STATUS_SUCCESS;
}
globals.SKYPIAX_INTERFACES[interface_id].skypiax_api_thread);
}
}
+
+ switch_safe_free(globals.dialplan);
+ switch_safe_free(globals.context);
+ switch_safe_free(globals.destination);
+ switch_safe_free(globals.codec_string);
+ switch_safe_free(globals.codec_rates_string);
+
return SWITCH_STATUS_SUCCESS;
}
{
switch_application_interface_t *app_interface;
switch_api_interface_t *api_interface;
-
+
+ memset(&prefs, 0, sizeof(prefs));
+
switch_mutex_init(&globals.listener_mutex, SWITCH_MUTEX_NESTED, pool);
/* intialize the unique reference stuff */
switch_sleep(1500000); /* sleep for 1.5 seconds */
+ switch_safe_free(prefs.ip);
+ switch_safe_free(prefs.cookie);
+ switch_safe_free(prefs.nodename);
+
return SWITCH_STATUS_SUCCESS;
}
switch_core_hash_destroy(&globals.event_hash);
+ switch_safe_free(globals.address);
+ switch_safe_free(globals.bindings);
+
return SWITCH_STATUS_SUCCESS;
}
switch_event_unbind(&globals.node);
+ switch_safe_free(prefs.ip);
+ switch_safe_free(prefs.password);
+
return SWITCH_STATUS_SUCCESS;
}
switch_application_interface_t *app_interface;
switch_api_interface_t *api_interface;
+ memset(&globals, 0, sizeof(globals));
+
switch_mutex_init(&globals.listener_mutex, SWITCH_MUTEX_NESTED, pool);
memset(&listen_list, 0, sizeof(listen_list));
{
switch_status_t status;
*module_interface = &console_module_interface;
+
+ memset(&globals, 0, sizeof(globals));
if ((status = load_config()) != SWITCH_STATUS_SUCCESS) {
return status;
setlogmask(LOG_UPTO(LOG_DEBUG));
switch_log_bind_logger(mod_syslog_logger, log_level, SWITCH_FALSE);
+ switch_safe_free(globals.ident);
+ switch_safe_free(globals.format);
+
return SWITCH_STATUS_SUCCESS;
}
switch_yield(100000);
} while (globals.running);
+ switch_safe_free(globals.realm);
+ switch_safe_free(globals.user);
+ switch_safe_free(globals.pass);
+
return SWITCH_STATUS_SUCCESS;
}