Merge pull request #373 from signalwire/switch_loadable_module

[Core] scan-build: Fix possible dereference of null pointer in switch_loadable_module_sort_codecs()
This commit is contained in:
Andrey Volk
2020-02-16 01:49:39 +04:00
committed by GitHub
+1 -1
View 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;