From: José Bollo Date: Mon, 27 Feb 2017 08:31:33 +0000 (+0100) Subject: fix SEGFLT when unhendled request X-Git-Tag: dab_3.99.1~136 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=e5d40e32d1f01b98c7344dae3707a38720e08666;p=src%2Fapp-framework-binder.git fix SEGFLT when unhendled request Change-Id: I34c657972111db843d0d9d26a1732b21ac519c57 Signed-off-by: José Bollo --- 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)