From: Dragos Oancea Date: Thu, 30 Jan 2020 22:02:16 +0000 (+0000) Subject: [core] scan-build: Access to field 'microseconds_per_packet' results in a dereference... X-Git-Tag: v1.10.3^2~227^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F278%2Fhead;p=thirdparty%2Ffreeswitch.git [core] scan-build: Access to field 'microseconds_per_packet' results in a dereference of a null pointer --- diff --git a/src/switch_loadable_module.c b/src/switch_loadable_module.c index 85ab3991e8..ca761c22df 100644 --- a/src/switch_loadable_module.c +++ b/src/switch_loadable_module.c @@ -2678,7 +2678,13 @@ static void switch_loadable_module_sort_codecs(const switch_codec_implementation #endif for (i = 0; i < arraylen; i++) { - int this_ptime = array[i]->microseconds_per_packet / 1000; + int this_ptime; + + if (!array[i]) { + continue; + } + + this_ptime = array[i]->microseconds_per_packet / 1000; if (!strcasecmp(array[i]->iananame, "ilbc")) { this_ptime = 20;