summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--server.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/server.c b/server.c
index e3261be..61e23bc 100644
--- a/server.c
+++ b/server.c
@@ -130,7 +130,10 @@ int main(int argc, char *argv[]) {
 			error = request(&req);
 			if (error && error != KCGI_HUP) break;
 		}
-		errx(EX_PROTOCOL, "khttp_fcgi_parse: %s", kcgi_strerror(error));
+		if (error != KCGI_EXIT) {
+			errx(EX_PROTOCOL, "khttp_fcgi_parse: %s", kcgi_strerror(error));
+		}
+		khttp_fcgi_free(fcgi);
 	} else {
 		struct kreq req;
 		enum kcgi_err error = khttp_parse(