]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-11903: Fix errors reported by PVS-Studio Static Code Analyzer for switch_core_io.c
authorAndrey Volk <andywolk@gmail.com>
Fri, 12 Jul 2019 16:40:35 +0000 (20:40 +0400)
committerAndrey Volk <andywolk@gmail.com>
Mon, 15 Jul 2019 19:41:37 +0000 (23:41 +0400)
src/switch_core_io.c

index 7560465187243af51e4f726187f018d13811a1e3..8b12efaffb7974897bc4e5049b5c0dad08337992 100644 (file)
@@ -669,7 +669,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
                                        continue;
                                }
 
-                               if (ok && switch_test_flag(bp, SMBF_READ_REPLACE)) {
+                               if (switch_test_flag(bp, SMBF_READ_REPLACE)) {
                                        do_bugs = 0;
                                        if (bp->callback) {
                                                bp->read_replace_frame_in = read_frame;
@@ -720,7 +720,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
                                        continue;
                                }
 
-                               if (ok && bp->ready && switch_test_flag(bp, SMBF_READ_STREAM)) {
+                               if (bp->ready && switch_test_flag(bp, SMBF_READ_STREAM)) {
                                        switch_mutex_lock(bp->read_mutex);
                                        if (bp->read_demux_frame) {
                                                uint8_t data[SWITCH_RECOMMENDED_BUFFER_SIZE];
@@ -755,7 +755,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
                        }
                }
 
-               if (do_bugs || tap_only) {
+               if (do_bugs) {
                        goto done;
                }
 
@@ -985,12 +985,12 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_recv_dtmf(switch_core_sessio
                return SWITCH_STATUS_FALSE;
        }
 
+       switch_assert(dtmf);
+
        if (switch_test_flag(dtmf, DTMF_FLAG_SENSITIVE)) {
                return SWITCH_STATUS_SUCCESS;
        }
 
-       switch_assert(dtmf);
-
        new_dtmf = *dtmf;
 
        if (new_dtmf.duration > switch_core_max_dtmf_duration(0)) {