mwi_topic_pool = NULL;
ao2_cleanup(mwi_topic_all);
mwi_topic_all = NULL;
+ ao2_cleanup(mwi_state_cache);
+ mwi_state_cache = NULL;
mwi_topic_cached = stasis_caching_unsubscribe_and_join(mwi_topic_cached);
STASIS_MESSAGE_TYPE_CLEANUP(ast_mwi_state_type);
STASIS_MESSAGE_TYPE_CLEANUP(ast_mwi_vm_app_type);
static void really_quit(int num, shutdown_nice_t niceness, int restart)
{
int active_channels;
- RAII_VAR(struct ast_json *, json_object, NULL, ast_json_unref);
+ struct ast_json *json_object = NULL;
int run_cleanups = niceness >= SHUTDOWN_NICE;
if (run_cleanups) {
"Shutdown", active_channels ? "Uncleanly" : "Cleanly",
"Restart", restart ? "True" : "False");
ast_manager_publish_event("Shutdown", EVENT_FLAG_SYSTEM, json_object);
+ ast_json_unref(json_object);
+ json_object = NULL;
}
ast_verb(0, "Asterisk %s ending (%d).\n",
active_channels ? "uncleanly" : "cleanly", num);
static void handle_dial_message(void *data, struct stasis_subscription *sub, struct stasis_topic *topic, struct stasis_message *message)
{
RAII_VAR(struct module_config *, mod_cfg, ao2_global_obj_ref(module_configs), ao2_cleanup);
- struct cdr_object *cdr;
+ RAII_VAR(struct cdr_object *, cdr, NULL, ao2_cleanup);
struct ast_multi_channel_blob *payload = stasis_message_data(message);
struct ast_channel_snapshot *caller;
struct ast_channel_snapshot *peer;
bridge_subscription = stasis_unsubscribe_and_join(bridge_subscription);
parking_subscription = stasis_unsubscribe_and_join(parking_subscription);
stasis_message_router_unsubscribe_and_join(stasis_router);
+ ao2_cleanup(cdr_topic);
+ cdr_topic = NULL;
}
static void cdr_engine_shutdown(void)
cel_dialstatus_store = NULL;
ao2_cleanup(linkedids);
linkedids = NULL;
+ ao2_cleanup(cel_backends);
+ cel_backends = NULL;
STASIS_MESSAGE_TYPE_CLEANUP(cel_generic_type);
}
if (!ast_strlen_zero(file->skip_category)) {
regex_skip = build_regex(file->skip_category);
if (!regexec(regex_skip, cat, 0, NULL, 0)) {
+ regfree(regex_skip);
ast_free(regex_skip);
return 0;
}
+ regfree(regex_skip);
ast_free(regex_skip);
}
static struct ast_json *json_array_from_list(const char *list, const char *sep)
{
RAII_VAR(struct ast_json *, array, ast_json_array_create(), ast_json_unref);
- RAII_VAR(char *, stringp, ast_strdup(list), ast_free);
- char *ext;
+ char *stringp, *ext;
+ stringp = ast_strdupa(list); /* this is in the stack so does not need to be freed */
if (!array || !stringp) {
return NULL;
}
stasis_message_router_unsubscribe_and_join(stasis_router);
stasis_router = NULL;
}
+ stasis_unsubscribe_and_join(rtp_topic_forwarder);
+ rtp_topic_forwarder = NULL;
ao2_cleanup(manager_topic);
manager_topic = NULL;
STASIS_MESSAGE_TYPE_CLEANUP(ast_manager_get_generic_type);
static void config_exit(void)
{
aco_info_destroy(&cfg_info);
+ ao2_global_obj_release(confs);
}
int stasis_config_init(void)