From ff26e14eede61e5873120402c24f750116818cfc Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Thu, 10 Aug 2017 19:46:33 +0200 Subject: [PATCH] api: fix shutdown of half-established connections (closes #115) --- lib/api.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/api.c b/lib/api.c index ebca6d24a..5fe95dfa8 100644 --- a/lib/api.c +++ b/lib/api.c @@ -150,6 +150,9 @@ int api_http_protocol_cb(struct lws *wsi, enum lws_callback_reasons reason, void break; case LWS_CALLBACK_CLOSED_HTTP: + if (!s) + return -1; + ret = api_session_destroy(s); if (ret) return -1;