]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
translate.c: Avoid refleak when checking for a translation path
authorSean Bright <sean.bright@gmail.com>
Fri, 30 Apr 2021 20:21:55 +0000 (16:21 -0400)
committerSean Bright <sean@seanbright.com>
Fri, 30 Apr 2021 20:31:58 +0000 (15:31 -0500)
Change-Id: Idbd61ff77545f4a78b06a5064b55112e774b70e6

main/translate.c

index 6604d14ff42491d48a9cbb1bd296fe726a2ef1ee..27e73f6d60b5dc1bbde86e6e1049bc6b1bc0e9ee 100644 (file)
@@ -1527,7 +1527,7 @@ static void check_translation_path(
           destination format. */
        for (i = ast_format_cap_count(result) - 1; 0 <= i; i--) {
                int index, src_index;
-               struct ast_format *fmt = ast_format_cap_get_format(result, i);
+               RAII_VAR(struct ast_format *, fmt, ast_format_cap_get_format(result, i), ao2_cleanup);
 
                if (ast_format_get_type(fmt) != type) {
                        continue;