From 95e31cb1266939dffc7c19575c18e6ef19e5742a Mon Sep 17 00:00:00 2001 From: Andy Green Date: Sun, 3 Jun 2018 17:09:27 +0800 Subject: [PATCH] minimal ring: keep coverity happy for NULL pointer possibility --- .../ws-server/minimal-ws-server-ring/protocol_lws_minimal.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/minimal-examples/ws-server/minimal-ws-server-ring/protocol_lws_minimal.c b/minimal-examples/ws-server/minimal-ws-server-ring/protocol_lws_minimal.c index 725cdf796..bd88f0295 100644 --- a/minimal-examples/ws-server/minimal-ws-server-ring/protocol_lws_minimal.c +++ b/minimal-examples/ws-server/minimal-ws-server-ring/protocol_lws_minimal.c @@ -119,6 +119,10 @@ cull_lagging_clients(struct per_vhost_data__minimal *vhd) } lws_end_foreach_llp_safe(ppss); + /* it would mean we lost track of oldest... but Coverity insists */ + if (!old_pss) + return; + /* * Let's recover (ie, free up) all the ring slots between the * original oldest's last one and the "worst" survivor.