From 0171e18657e458b870dabedf290f93b794b52587 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Sun, 16 Feb 2020 01:29:04 +0400 Subject: [PATCH] [Core] scan-build: Fix possible dereference of null pointer in switch_loadable_module_sort_codecs() --- src/switch_loadable_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/switch_loadable_module.c b/src/switch_loadable_module.c index c99d18e9aa..174644faff 100644 --- a/src/switch_loadable_module.c +++ b/src/switch_loadable_module.c @@ -2696,7 +2696,7 @@ static void switch_loadable_module_sort_codecs(const switch_codec_implementation #endif } - if (i > 0 && strcasecmp(array[i]->iananame, array[i-1]->iananame) && this_ptime != sorted_ptime) { + if (i > 0 && array[i-1] && strcasecmp(array[i]->iananame, array[i-1]->iananame) && this_ptime != sorted_ptime) { int j; int swapped = 0;