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

Joshua Colp asteriskteam at digium.com
Tue May 4 06:16:39 CDT 2021


Joshua Colp has submitted this change. ( 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(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Joshua Colp: Approved for Submit



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-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210504/e1271ee1/attachment.html>


More information about the asterisk-code-review mailing list