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

Joshua Colp asteriskteam at digium.com
Tue May 4 06:17:04 CDT 2021


Joshua Colp has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/15850 )

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/+/15850
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 18
Gerrit-Change-Id: Idbd61ff77545f4a78b06a5064b55112e774b70e6
Gerrit-Change-Number: 15850
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/86411cea/attachment.html>


More information about the asterisk-code-review mailing list