Browse Source

Fix segfault when ps not found

pull/1295/head
Stefan Mititelu 5 years ago
parent
commit
96c05d3fcf
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      daemon/statistics.c

+ 6
- 2
daemon/statistics.c View File

@ -234,10 +234,14 @@ void statistics_update_oneway(struct call* c) {
} }
if (found) { break; } if (found) { break; }
} }
if (!found) if (!found)
ps = NULL; ps = NULL;
struct sink_handler *sh = g_queue_peek_head(&ps->rtp_sinks);
ps2 = sh ? sh->sink : NULL;
if (ps) {
struct sink_handler *sh = g_queue_peek_head(&ps->rtp_sinks);
ps2 = sh ? sh->sink : NULL;
}
if (ps && ps2 && atomic64_get(&ps2->stats.packets)==0) { if (ps && ps2 && atomic64_get(&ps2->stats.packets)==0) {
if (atomic64_get(&ps->stats.packets)!=0 && IS_OWN_CALL(c)){ if (atomic64_get(&ps->stats.packets)!=0 && IS_OWN_CALL(c)){


Loading…
Cancel
Save