audiohooks: Clean references to formats
authorCorey Farrell <git@cfware.com>
Thu, 30 Oct 2014 23:45:25 +0000 (23:45 +0000)
committerCorey Farrell <git@cfware.com>
Thu, 30 Oct 2014 23:45:25 +0000 (23:45 +0000)
Cleanup references to in_translate[x].format and
out_translate[x].format in ast_audiohook_detach_list.

ASTERISK-24465 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4124/
........

Merged revisions 426803 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426804 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/audiohook.c

index 1c0f2c7..e01b1ce 100644 (file)
@@ -558,9 +558,11 @@ void ast_audiohook_detach_list(struct ast_audiohook_list *audiohook_list)
        for (i = 0; i < 2; i++) {
                if (audiohook_list->in_translate[i].trans_pvt) {
                        ast_translator_free_path(audiohook_list->in_translate[i].trans_pvt);
        for (i = 0; i < 2; i++) {
                if (audiohook_list->in_translate[i].trans_pvt) {
                        ast_translator_free_path(audiohook_list->in_translate[i].trans_pvt);
+                       ao2_cleanup(audiohook_list->in_translate[i].format);
                }
                if (audiohook_list->out_translate[i].trans_pvt) {
                        ast_translator_free_path(audiohook_list->out_translate[i].trans_pvt);
                }
                if (audiohook_list->out_translate[i].trans_pvt) {
                        ast_translator_free_path(audiohook_list->out_translate[i].trans_pvt);
+                       ao2_cleanup(audiohook_list->in_translate[i].format);
                }
        }
 
                }
        }