diff options
-rw-r--r-- | src/afb-hsrv.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/afb-hsrv.c b/src/afb-hsrv.c index 91dff296..577ef854 100644 --- a/src/afb-hsrv.c +++ b/src/afb-hsrv.c @@ -238,9 +238,11 @@ static void end_handler(void *cls, struct MHD_Connection *connection, void **rec struct afb_hreq *hreq; hreq = *recordreq; - if (hreq->upgrade) - MHD_suspend_connection (connection); - afb_hreq_unref(hreq); + if (hreq) { + if (hreq->upgrade) + MHD_suspend_connection (connection); + afb_hreq_unref(hreq); + } } void run_micro_httpd(struct afb_hsrv *hsrv) |