1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-30 00:00:16 +01:00

coverity: ss: mqtt: remove needless wsi check

881     	case LWS_CALLBACK_MQTT_UNSUBSCRIBE_TIMEOUT:
>>>     CID 392688:    (REVERSE_INULL)
>>>     Null-checking "wsi" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
882     		if (!wsi || !wsi->mqtt)
883     			return -1;

wsi can't be NULL for a callback specific to a wsi.
This commit is contained in:
Andy Green 2022-05-04 07:38:49 +01:00
parent 1d5c865410
commit 43ba912b2b

View file

@ -879,7 +879,7 @@ secstream_mqtt(struct lws *wsi, enum lws_callback_reasons reason, void *user,
}
case LWS_CALLBACK_MQTT_UNSUBSCRIBE_TIMEOUT:
if (!wsi || !wsi->mqtt)
if (!wsi->mqtt)
return -1;
if (wsi->mqtt->inside_shadow) {
@ -899,7 +899,7 @@ secstream_mqtt(struct lws *wsi, enum lws_callback_reasons reason, void *user,
break;
case LWS_CALLBACK_MQTT_SHADOW_TIMEOUT:
if (!wsi || !wsi->mqtt)
if (!wsi->mqtt)
return -1;
if (wsi->mqtt->inside_shadow) {