Index: main/cdr.c =================================================================== --- main/cdr.c (revision 397513) +++ main/cdr.c (working copy) @@ -3929,6 +3929,8 @@ 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) Index: main/manager.c =================================================================== --- main/manager.c (revision 397513) +++ main/manager.c (working copy) @@ -7755,6 +7755,8 @@ 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); Index: main/app.c =================================================================== --- main/app.c (revision 397513) +++ main/app.c (working copy) @@ -3001,6 +3001,8 @@ 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); Index: main/stasis_config.c =================================================================== --- main/stasis_config.c (revision 397513) +++ main/stasis_config.c (working copy) @@ -172,6 +172,7 @@ static void config_exit(void) { aco_info_destroy(&cfg_info); + ao2_global_obj_release(confs); } int stasis_config_init(void) Index: main/asterisk.c =================================================================== --- main/asterisk.c (revision 397513) +++ main/asterisk.c (working copy) @@ -1920,7 +1920,7 @@ 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) { @@ -1958,6 +1958,8 @@ "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); Index: main/cel.c =================================================================== --- main/cel.c (revision 397513) +++ main/cel.c (working copy) @@ -1337,6 +1337,8 @@ cel_dialstatus_store = NULL; ao2_cleanup(linkedids); linkedids = NULL; + ao2_cleanup(cel_backends); + cel_backends = NULL; STASIS_MESSAGE_TYPE_CLEANUP(cel_generic_type); } Index: main/file.c =================================================================== --- main/file.c (revision 397513) +++ main/file.c (working copy) @@ -75,9 +75,9 @@ 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; } Index: main/config_options.c =================================================================== --- main/config_options.c (revision 397513) +++ main/config_options.c (working copy) @@ -447,9 +447,11 @@ 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); }