From: Jakub Karolczyk Date: Mon, 13 May 2024 11:25:47 +0000 (+0100) Subject: [core] Fix scan-build 14 in port allocator X-Git-Tag: v1.10.12^2~35^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=41bc763d800a9fef127d238e88a797470b1256f9;p=thirdparty%2Ffreeswitch.git [core] Fix scan-build 14 in port allocator --- diff --git a/src/switch_core_port_allocator.c b/src/switch_core_port_allocator.c index 3bbed2a351..074ce5f5ea 100644 --- a/src/switch_core_port_allocator.c +++ b/src/switch_core_port_allocator.c @@ -150,7 +150,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_port_allocator_request_port(switch_c switch_mutex_lock(alloc->mutex); srand((unsigned) ((unsigned) (intptr_t) port_ptr + (unsigned) (intptr_t) switch_thread_self() + switch_micro_time_now())); - while (alloc->track_used < alloc->track_len) { + while (alloc->track_len && alloc->track_used < alloc->track_len) { uint32_t index; uint32_t tries = 0;