[core] Coverity fixes

* [core] Coverity 1518099, 1518097, 1518098 (Unchecked return value from library)

* [core] Coverity 1468551 Unchecked return value

* [core] Coverity 1468293 Unchecked return value

* [core] Coverity 1468274 Explicit null dereferenced

* [core] Coverity 1395588 Unchecked return value

* [core] Coverity 1395515 Logically dead code

* [core] Coverity 1364984 Result is not floating-point

* [core] Coverity 1395554, 1468440 Dereference before null check

* [core] Coverity 1024487 Dereference after null check

* [core] Coverity 1024872 Unchecked return value

* [core] Coverity 1025822 Unchecked return value

* [core] Coverity 1025823 Unchecked return value

* [core] Coverity 1087637, 1346467, 1087638 Unchecked return value

* [core] Coverity 1107607 Unchecked return value

* [core] Coverity 1210777 Unchecked return value

* [core] Coverity 1227670 Dereference before null check

* [core] Coverity 1024551 Logically dead code

* [core] Coverity 1024560 Logically dead code

* [core] Coverity 1024664 Operands don't affect result

* [core] Coverity 1364957 Dereference after null check

* [core] Coverity 1395572 Logically dead code

* [core] Coverity 1412459 Unchecked return value

* [core] Coverity 1412490 Unchecked return value

* [core] Coverity 1395515/2 Logically dead code

* [core] Coverity cleanup
This commit is contained in:
Jakub Karolczyk
2023-09-08 18:17:57 +01:00
committed by GitHub
parent b6ccc27e6f
commit bb9afcb388
14 changed files with 142 additions and 80 deletions
+7 -6
View File
@@ -98,6 +98,7 @@ SWITCH_DECLARE(Event *) EventConsumer::pop(int block, int timeout)
void *pop = NULL;
Event *ret = NULL;
switch_event_t *event;
switch_status_t res;
if (!ready) {
return NULL;
@@ -105,14 +106,16 @@ SWITCH_DECLARE(Event *) EventConsumer::pop(int block, int timeout)
if (block) {
if (timeout > 0) {
switch_queue_pop_timeout(events, &pop, (switch_interval_time_t) timeout * 1000); // millisec rather than microsec
res = switch_queue_pop_timeout(events, &pop, (switch_interval_time_t) timeout * 1000); // millisec rather than microsec
} else {
switch_queue_pop(events, &pop);
res = switch_queue_pop(events, &pop);
}
} else {
switch_queue_trypop(events, &pop);
res = switch_queue_trypop(events, &pop);
}
(void)res;
if ((event = (switch_event_t *) pop)) {
ret = new Event(event, 1);
}
@@ -138,9 +141,7 @@ SWITCH_DECLARE(void) EventConsumer::cleanup()
node_index = 0;
if (events) {
switch_queue_interrupt_all(events);
}
switch_queue_interrupt_all(events);
while(switch_queue_trypop(events, &pop) == SWITCH_STATUS_SUCCESS) {
switch_event_t *event = (switch_event_t *) pop;