From e5d40e32d1f01b98c7344dae3707a38720e08666 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Bollo?= Date: Mon, 27 Feb 2017 09:31:33 +0100 Subject: [PATCH] fix SEGFLT when unhendled request MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: I34c657972111db843d0d9d26a1732b21ac519c57 Signed-off-by: José Bollo --- src/afb-hsrv.c | 8 +++++--- 1 file 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) -- 2.16.6