From 9608a5687399223910690adb8318f80b6ad4d3cc Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Wed, 18 Nov 2020 21:50:04 +0400 Subject: [PATCH] [Core] Fix leaks in switch_ivr_park when initially no rate. --- src/switch_ivr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/switch_ivr.c b/src/switch_ivr.c index be319e353e..9aa05fcd73 100644 --- a/src/switch_ivr.c +++ b/src/switch_ivr.c @@ -1011,7 +1011,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_park(switch_core_session_t *session, rate = read_impl.actual_samples_per_second; bpf = read_impl.decoded_bytes_per_packet; - if ((var = switch_channel_get_variable(channel, SWITCH_SEND_SILENCE_WHEN_IDLE_VARIABLE)) && (sval = atoi(var))) { + if (rate && (var = switch_channel_get_variable(channel, SWITCH_SEND_SILENCE_WHEN_IDLE_VARIABLE)) && (sval = atoi(var))) { switch_core_session_get_read_impl(session, &imp); if (switch_core_codec_init(&codec,