mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 03:20:57 +00:00
Fix various memory leaks
main/config.c - cleanup cache fie includes res/res_security_log.c - unregister logger level channesl/chan_sip.c - cleanup io context and notify_types main/translator.c - cleanup at shutdown main/named_acl.c - cleanup cli commands main/indications.c - ast_get_indication_tone() unref default_tone_zone if used (closes issues ASTERISK-22378) Reported by: Corey Farrell Patches: config_shutdown.patch uploaded by coreyfarrell (license 5909) res_security_log.patch uploaded by coreyfarrell (license 5909) chan_sip-11.patch uploaded by coreyfarrell (license 5909) indications_refleak.patch uploaded by coreyfarrell (license 5909) named_acl-cli_unreg-trunk.patch uploaded by coreyfarrell (license 5909) translate_shutdown.patch uploaded by coreyfarrell (license 5909) ........ Merged revisions 398102 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 398103 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 398116 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398124 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1396,11 +1396,27 @@ void ast_translate_available_formats(struct ast_format_cap *dest, struct ast_for
|
||||
ast_format_cap_iter_end(src);
|
||||
}
|
||||
|
||||
static void translate_shutdown(void)
|
||||
{
|
||||
int x;
|
||||
ast_cli_unregister_multiple(cli_translate, ARRAY_LEN(cli_translate));
|
||||
|
||||
ast_rwlock_wrlock(&tablelock);
|
||||
for (x = 0; x < index_size; x++) {
|
||||
ast_free(__matrix[x]);
|
||||
}
|
||||
ast_free(__matrix);
|
||||
ast_free(__indextable);
|
||||
ast_rwlock_unlock(&tablelock);
|
||||
ast_rwlock_destroy(&tablelock);
|
||||
}
|
||||
|
||||
int ast_translate_init(void)
|
||||
{
|
||||
int res = 0;
|
||||
ast_rwlock_init(&tablelock);
|
||||
res = matrix_resize(1);
|
||||
res |= ast_cli_register_multiple(cli_translate, ARRAY_LEN(cli_translate));
|
||||
ast_register_atexit(translate_shutdown);
|
||||
return res;
|
||||
}
|
||||
|
Reference in New Issue
Block a user