From 862e675ffc975c515b81f5b7fdf407128be3d7b9 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Fri, 12 Jul 2019 20:43:32 +0400 Subject: [PATCH] FS-11903: Fix errors reported by PVS-Studio Static Code Analyzer for switch_loadable_module.c --- src/switch_loadable_module.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/switch_loadable_module.c b/src/switch_loadable_module.c index e8f2564b7e..b92400472b 100644 --- a/src/switch_loadable_module.c +++ b/src/switch_loadable_module.c @@ -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; }