[Asterisk-code-review] channel: Fix memory leak in suppress API. (asterisk[certified/16.8])

Friendly Automation asteriskteam at digium.com
Wed Mar 3 10:07:58 CST 2021


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

Change subject: channel: Fix memory leak in suppress API.
......................................................................

channel: Fix memory leak in suppress API.

A frame suppression API exists as part of channels
which allows audio frames to or from a channel to
be dropped. The MuteAudio AMI action uses this
API to perform its job.

This API uses a framehook to intercept flowing
audio and drop it when appropriate. It is the
responsibility of the framehook to free the
frame it is given if it changes the frame. The
suppression API failed to do this resulting in
a leak of audio frames.

This change adds the freeing of these frames.

ASTERISK-29071

Change-Id: Ie50acd454d672d36af914050c327d2e120d8ba7b
---
M main/channel.c
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/main/channel.c b/main/channel.c
index 8fb0a8f..2a0815e 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -10800,6 +10800,7 @@
 	if (suppress_frame) {
 		switch (frame->frametype) {
 		case AST_FRAME_VOICE:
+			ast_frfree(frame);
 			frame = &ast_null_frame;
 			break;
 		default:

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

Gerrit-Project: asterisk
Gerrit-Branch: certified/16.8
Gerrit-Change-Id: Ie50acd454d672d36af914050c327d2e120d8ba7b
Gerrit-Change-Number: 15538
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210303/2b495431/attachment-0001.html>


More information about the asterisk-code-review mailing list