[Asterisk-code-review] app_read: Release tone zone reference on early return (asterisk[16])

Sean Bright asteriskteam at digium.com
Wed Feb 3 12:52:28 CST 2021


Sean Bright has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/15393 )


Change subject: app_read: Release tone zone reference on early return
......................................................................

app_read: Release tone zone reference on early return

Change-Id: I350939f2220f9e5d44ddf4c8d9a4c99fde4d169a
---
M apps/app_read.c
1 file changed, 3 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/93/15393/1

diff --git a/apps/app_read.c b/apps/app_read.c
index f919357..6398281 100644
--- a/apps/app_read.c
+++ b/apps/app_read.c
@@ -195,6 +195,9 @@
 	if (ast_channel_state(chan) != AST_STATE_UP) {
 		if (ast_test_flag(&flags, OPT_SKIP)) {
 			/* At the user's option, skip if the line is not up */
+			if (ts) {
+				ts = ast_tone_zone_sound_unref(ts);
+			}
 			pbx_builtin_setvar_helper(chan, arglist.variable, "");
 			pbx_builtin_setvar_helper(chan, "READSTATUS", "SKIPPED");
 			return 0;

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

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I350939f2220f9e5d44ddf4c8d9a4c99fde4d169a
Gerrit-Change-Number: 15393
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210203/23e1fd16/attachment.html>


More information about the asterisk-code-review mailing list