From b730725c55ce2502e3a8b6ab88402911075fb5f0 Mon Sep 17 00:00:00 2001 From: "Alfred E. Heggestad" Date: Fri, 28 Apr 2017 14:11:07 +0200 Subject: httpd: fix a crash (fixes #238) --- modules/httpd/httpd.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/httpd/httpd.c b/modules/httpd/httpd.c index 8348a43..769e106 100644 --- a/modules/httpd/httpd.c +++ b/modules/httpd/httpd.c @@ -91,7 +91,7 @@ static void http_req_handler(struct http_conn *conn, const struct http_msg *msg, void *arg) { int err; - char *buf; + char *buf = NULL; struct pl nprm; (void)arg; @@ -120,10 +120,9 @@ static void http_req_handler(struct http_conn *conn, return; - error: - mem_deref(buf); - http_ereply(conn, 404, "Not Found"); - + error: + mem_deref(buf); + http_ereply(conn, 404, "Not Found"); } -- cgit v1.2.3