]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[Core] scan-build: Fix possible dereference of null pointer in switch_loadable_module... 373/head
authorAndrey Volk <andywolk@gmail.com>
Sat, 15 Feb 2020 21:29:04 +0000 (01:29 +0400)
committerAndrey Volk <andywolk@gmail.com>
Sat, 15 Feb 2020 21:30:31 +0000 (01:30 +0400)
src/switch_loadable_module.c

index c99d18e9aa67888081afaacf46b7c4572fb2258c..174644faffde1f03ebada43cba756b65fd9fb2b1 100644 (file)
@@ -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;