coverity 169268 + 169270- dead code plus repeat NULL check on error path
authorAndy Green <andy@warmcat.com>
Sun, 28 Aug 2016 01:15:26 +0000 (09:15 +0800)
committerAndy Green <andy@warmcat.com>
Sun, 28 Aug 2016 01:44:15 +0000 (09:44 +0800)
lib/client.c

index 4171cbc..6af36c8 100755 (executable)
@@ -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");