From a20fb00789120182ebdd91c7006bdfbb3f19d421 Mon Sep 17 00:00:00 2001 From: Joris Vink Date: Sun, 2 Aug 2015 16:53:40 +0200 Subject: [PATCH] req can be NULL if we are coming from an error path. --- src/http.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/http.c b/src/http.c index 45d0aa9..e090687 100644 --- a/src/http.c +++ b/src/http.c @@ -1247,7 +1247,8 @@ http_response_normal(struct http_request *req, struct connection *c, } } - if (req->owner->proto != CONN_PROTO_WEBSOCKET) { + /* Note that req CAN be NULL. */ + if (req != NULL && req->owner->proto != CONN_PROTO_WEBSOCKET) { if (http_keepalive_time && connection_close == 0) { kore_buf_appendf(header_buf, "connection: keep-alive\r\n");