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

index e8f2564b7ead5d66e2cd213ba0a458956d57cca4..b92400472b0a4e8e76b60b552bc795edbcde144e 100644 (file)
@@ -2525,9 +2525,7 @@ SWITCH_DECLARE(switch_endpoint_interface_t *) switch_loadable_module_get_endpoin
 
        switch_mutex_lock(loadable_modules.mutex);
        ptr = switch_core_hash_find(loadable_modules.endpoint_hash, name);
-       if (ptr) {
-               PROTECT_INTERFACE(ptr);
-       }
+       PROTECT_INTERFACE(ptr);
        switch_mutex_unlock(loadable_modules.mutex);
 
 
@@ -2611,9 +2609,7 @@ SWITCH_DECLARE(switch_codec_interface_t *) switch_loadable_module_get_codec_inte
 
        switch_mutex_unlock(loadable_modules.mutex);
 
-       if (codec) {
-               PROTECT_INTERFACE(codec);
-       }
+       PROTECT_INTERFACE(codec);
 
        return codec;
 }