Commit a02d5f81107cb783552f0f456fccf21a313ec9c9

Stefan Sperling 2020-02-13T10:05:24

break out of loop on error, instead of returning, in gw_index()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/gotweb/gotweb.c b/gotweb/gotweb.c
index 137f85d..a8bbb9d 100644
--- a/gotweb/gotweb.c
+++ b/gotweb/gotweb.c
@@ -636,11 +636,13 @@ gw_index(struct gw_trans *gw_trans)
 		kerr = khtml_attr(gw_trans->gw_html_req, KELEM_DIV, KATTR_ID,
 		    "index_wrapper", KATTR__MAX);
 		if (kerr != KCGI_OK)
-			return gw_kcgi_error(kerr);
+			goto done;
 
 		if (asprintf(&href_summary, "?path=%s&action=summary",
-		    gw_dir->name) == -1)
-			return got_error_from_errno("asprintf");
+		    gw_dir->name) == -1) {
+			error = got_error_from_errno("asprintf");
+			goto done;
+		}
 		kerr = khtml_attr(gw_trans->gw_html_req, KELEM_DIV, KATTR_ID,
 		    "index_project", KATTR__MAX);
 		if (kerr != KCGI_OK)