Commit 4bec75396a2266383964555b169c36d7beb339ff

Stefan Sperling 2020-01-29T14:07:45

missing error check in gw_display_index()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff --git a/gotweb/gotweb.c b/gotweb/gotweb.c
index 5e0028e..8f338a0 100644
--- a/gotweb/gotweb.c
+++ b/gotweb/gotweb.c
@@ -1186,9 +1186,13 @@ gw_display_open(struct gw_trans *gw_trans, enum khttp code, enum kmime mime)
 static const struct got_error *
 gw_display_index(struct gw_trans *gw_trans)
 {
+	const struct got_error *error;
 	enum kcgi_err kerr;
 
-	gw_display_open(gw_trans, KHTTP_200, gw_trans->mime);
+	error = gw_display_open(gw_trans, KHTTP_200, gw_trans->mime);
+	if (error)
+		return error;
+
 	kerr = khtml_open(gw_trans->gw_html_req, gw_trans->gw_req, 0);
 	if (kerr)
 		return gw_kcgi_error(kerr);