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

index c7fd49674a746eef4678b596de8b8ec73d7bef29..767754a59fee6bab46284d0b0ef3141137dee78f 100644 (file)
@@ -85,9 +85,8 @@ static void text_bridge_thread(switch_core_session_t *session, void *obj)
                                if (inuse + 4 > text_framesize) {
                                        void *tmp = malloc(inuse + 1024);
 
-                                       memcpy(tmp, text_framedata, text_framesize);
-
                                        switch_assert(tmp);
+                                       memcpy(tmp, text_framedata, text_framesize);
 
                                        text_framesize = inuse + 1024;
 
@@ -1914,7 +1913,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses
                        explicit = !strcasecmp(hup, "explicit");
                }
 
-               if (cause && !switch_channel_test_flag(peer_channel, CF_ANSWERED)) {
+               if (!switch_channel_test_flag(peer_channel, CF_ANSWERED)) {
                        switch_channel_handle_cause(caller_channel, cause);
                }