From: Andrey Volk Date: Wed, 18 Nov 2020 17:50:04 +0000 (+0400) Subject: [Core] Fix leaks in switch_ivr_park when initially no rate. X-Git-Tag: v1.10.6^2~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9608a5687399223910690adb8318f80b6ad4d3cc;p=thirdparty%2Ffreeswitch.git [Core] Fix leaks in switch_ivr_park when initially no rate. --- 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,