From aa2e6a8d2982e7de5e78e1a622adb670352ade61 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Tue, 23 Sep 2014 00:35:51 +0100 Subject: [PATCH] Fix possible NULL derefence. --- src/websockets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/websockets.c b/src/websockets.c index 6df5ae82..5c0741cc 100644 --- a/src/websockets.c +++ b/src/websockets.c @@ -243,7 +243,7 @@ static int callback_mqtt(struct libwebsocket_context *context, break; case LWS_CALLBACK_RECEIVE: - if(!u){ + if(!u || !u->mosq){ return -1; } mosq = u->mosq;