[Asterisk-code-review] translate.c: Avoid refleak when checking for a translation path (asterisk[16])

Sean Bright asteriskteam at digium.com
Fri Apr 30 15:27:53 CDT 2021


Sean Bright has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/15815 )


Change subject: translate.c: Avoid refleak when checking for a translation path
......................................................................

translate.c: Avoid refleak when checking for a translation path

Change-Id: Idbd61ff77545f4a78b06a5064b55112e774b70e6
---
M main/translate.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/15/15815/1

diff --git a/main/translate.c b/main/translate.c
index 6604d14..27e73f6 100644
--- a/main/translate.c
+++ b/main/translate.c
@@ -1527,7 +1527,7 @@
 	   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;

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/15815
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: Idbd61ff77545f4a78b06a5064b55112e774b70e6
Gerrit-Change-Number: 15815
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean at seanbright.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210430/453b428e/attachment.html>


More information about the asterisk-code-review mailing list