[Asterisk-code-review] res_rtp_asterisk: fix memory leak (asterisk[master])

Friendly Automation asteriskteam at digium.com
Thu Sep 30 09:23:01 CDT 2021


Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/16561 )

Change subject: res_rtp_asterisk: fix memory leak
......................................................................

res_rtp_asterisk: fix memory leak

Add missing reference decrement in rtp_deallocate_transport()

ASTERISK-29671

Change-Id: I8d22dbedb90e8dade0829b7a28372f404b07caa9
---
M res/res_rtp_asterisk.c
1 file changed, 5 insertions(+), 0 deletions(-)

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



diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index 8ede400..7b236be 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -3994,6 +3994,11 @@
 		rtp->ice_active_remote_candidates = NULL;
 	}
 
+	if (rtp->ice_proposed_remote_candidates) {
+		ao2_ref(rtp->ice_proposed_remote_candidates, -1);
+		rtp->ice_proposed_remote_candidates = NULL;
+	}
+
 	if (rtp->ioqueue) {
 		/*
 		 * We cannot hold the instance lock because we could wait

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

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I8d22dbedb90e8dade0829b7a28372f404b07caa9
Gerrit-Change-Number: 16561
Gerrit-PatchSet: 2
Gerrit-Owner: Jean Aunis - Prescom <jean.aunis at prescom.fr>
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-Reviewer: Sean Bright <sean at seanbright.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210930/750d62f3/attachment.html>


More information about the asterisk-code-review mailing list