[Asterisk-code-review] channel: Fix crash in suppress API. (asterisk[16])

Joshua Colp asteriskteam at digium.com
Tue Mar 9 18:37:37 CST 2021


Joshua Colp has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/15605 )


Change subject: channel: Fix crash in suppress API.
......................................................................

channel: Fix crash in suppress API.

There exists an inconsistency with framehook usage
such that it is only on reads that the frame should
be freed, not on writes as well.

ASTERISK-29071

Change-Id: I5ef918ebe4debac8a469e8d43bf9d6b673e8e472
---
M main/channel.c
1 file changed, 3 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/05/15605/1

diff --git a/main/channel.c b/main/channel.c
index 64d93c4..9154a2c 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -10845,7 +10845,9 @@
 	if (suppress_frame) {
 		switch (frame->frametype) {
 		case AST_FRAME_VOICE:
-			ast_frfree(frame);
+			if (event == AST_FRAMEHOOK_EVENT_READ) {
+				ast_frfree(frame);
+			}
 			frame = &ast_null_frame;
 			break;
 		default:

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

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I5ef918ebe4debac8a469e8d43bf9d6b673e8e472
Gerrit-Change-Number: 15605
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210309/f3700d6b/attachment.html>


More information about the asterisk-code-review mailing list