From: Andrey Volk Date: Fri, 12 Jul 2019 16:38:59 +0000 (+0400) Subject: FS-11903: Fix errors reported by PVS-Studio Static Code Analyzer for switch_core.c X-Git-Tag: v1.10.0~259 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7abf29f4fa46b1fa6dc828e3b23afbac869efff;p=thirdparty%2Ffreeswitch.git FS-11903: Fix errors reported by PVS-Studio Static Code Analyzer for switch_core.c --- diff --git a/src/switch_core.c b/src/switch_core.c index d81b7e520c..e03a041200 100644 --- a/src/switch_core.c +++ b/src/switch_core.c @@ -1307,11 +1307,7 @@ static void load_mime_types(void) } switch_safe_free(line_buf); - - if (fd) { - fclose(fd); - fd = NULL; - } + fclose(fd); end: @@ -2649,6 +2645,7 @@ SWITCH_DECLARE(int32_t) switch_core_session_ctl(switch_session_ctl_t cmd, void * if (!zstr(arg)) { tech = strdup(arg); + switch_assert(tech); if ((prof = strchr(tech, ':'))) { *prof++ = '\0'; @@ -2656,10 +2653,9 @@ SWITCH_DECLARE(int32_t) switch_core_session_ctl(switch_session_ctl_t cmd, void * if (!strcasecmp(tech, "flush")) { flush++; - tech = NULL; if (prof) { - tech = prof; + char *tech = prof; if ((prof = strchr(tech, ':'))) { *prof++ = '\0'; }