From: Andrey Volk Date: Sat, 15 Feb 2020 21:29:04 +0000 (+0400) Subject: [Core] scan-build: Fix possible dereference of null pointer in switch_loadable_module... X-Git-Tag: v1.10.3^2~153^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F373%2Fhead;p=thirdparty%2Ffreeswitch.git [Core] scan-build: Fix possible dereference of null pointer in switch_loadable_module_sort_codecs() --- 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;