From 24d6adfe99bf4a14a384bb6541cd9927360cdaa0 Mon Sep 17 00:00:00 2001 From: Sean Bright <sean.bright@gmail.com> Date: Wed, 3 Feb 2021 13:53:03 -0500 Subject: [PATCH] app_read: Release tone zone reference on early return. Change-Id: I350939f2220f9e5d44ddf4c8d9a4c99fde4d169a --- apps/app_read.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/app_read.c b/apps/app_read.c index f9193571d7..6398281bec 100644 --- a/apps/app_read.c +++ b/apps/app_read.c @@ -195,6 +195,9 @@ static int read_exec(struct ast_channel *chan, const char *data) 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; -- GitLab