From cd02a15669f3088609e3e89482c0aa871243edc3 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Sun, 28 Aug 2016 09:15:26 +0800 Subject: [PATCH] coverity 169268 + 169270- dead code plus repeat NULL check on error path --- lib/client.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/client.c b/lib/client.c index 4171cbc..6af36c8 100755 --- a/lib/client.c +++ b/lib/client.c @@ -921,9 +921,10 @@ bail3: close_reason = LWS_CLOSE_STATUS_NOSTATUS; bail2: - wsi->protocol->callback(wsi, LWS_CALLBACK_CLIENT_CONNECTION_ERROR, + if (wsi->protocol) + wsi->protocol->callback(wsi, LWS_CALLBACK_CLIENT_CONNECTION_ERROR, wsi->user_space, (void *)cce, - (unsigned int) (cce ? strlen(cce): 0)); + (unsigned int)strlen(cce)); wsi->already_did_cce = 1; lwsl_info("closing connection due to bail2 connection error\n"); -- 2.7.4