diff options
author | Alfred E. Heggestad <alfred.heggestad@gmail.com> | 2017-04-28 14:11:07 +0200 |
---|---|---|
committer | Alfred E. Heggestad <alfred.heggestad@gmail.com> | 2017-04-28 14:11:07 +0200 |
commit | b730725c55ce2502e3a8b6ab88402911075fb5f0 (patch) | |
tree | 38dec783f7fc58254566bdd0f902b560e29769ee /modules | |
parent | 0169798285f53bd4d01be10cf0e95f46f2d4b56a (diff) |
httpd: fix a crash (fixes #238)
Diffstat (limited to 'modules')
-rw-r--r-- | modules/httpd/httpd.c | 9 |
1 files 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"); } |