]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[Core] Fix leaks in switch_ivr_park when initially no rate.
authorAndrey Volk <andywolk@gmail.com>
Wed, 18 Nov 2020 17:50:04 +0000 (21:50 +0400)
committerAndrey Volk <andywolk@gmail.com>
Wed, 17 Mar 2021 15:27:00 +0000 (18:27 +0300)
src/switch_ivr.c

index be319e353e481fdd1b799e929b44feaab76c7bde..9aa05fcd739f7dc0bae9dd3d7d1689c45f577b4f 100644 (file)
@@ -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,