Commit Diff


commit - 2dcb56a8795aa01fa28e97093758b8f8fb976799
commit + c119608e535bdfbd661d54bb76fa27292fa218ec
blob - 8cc8ff99dbc8f9cd0039fb151b71d9d795991ec5
blob + 060b7e076846611ba547d754dc4ec28836ac3eeb
--- gotweb/gotweb.c
+++ gotweb/gotweb.c
@@ -2716,14 +2716,14 @@ main(int argc, char *argv[])
 	kerr = khttp_parse(gw_trans->gw_req, gw_keys, KEY__ZMAX, &page, 1, 0);
 	if (kerr != KCGI_OK) {
 		error = gw_kcgi_error(kerr);
-		goto err;
+		goto done;
 	}
 
 	if ((gw_trans->gw_conf =
 	    malloc(sizeof(struct gotweb_conf))) == NULL) {
 		gw_malloc = 0;
 		error = got_error_from_errno("malloc");
-		goto err;
+		goto done;
 	}
 
 	TAILQ_INIT(&gw_trans->gw_dirs);
@@ -2740,24 +2740,20 @@ main(int argc, char *argv[])
 	gw_trans->gw_tmpl->arg = gw_trans;
 	gw_trans->gw_tmpl->cb = gw_template;
 	error = parse_conf(GOTWEB_CONF, gw_trans->gw_conf);
-
-err:
-	if (error) {
-		gw_trans->mime = KMIME_TEXT_PLAIN;
-		gw_trans->action = GW_ERR;
-		gw_display_index(gw_trans, error);
+	if (error)
 		goto done;
-	}
 
 	error = gw_parse_querystring(gw_trans);
 	if (error)
-		goto err;
+		goto done;
 
 	error = gw_display_index(gw_trans, error);
-	if (error)
-		goto err;
-
 done:
+	if (error) {
+		gw_trans->mime = KMIME_TEXT_PLAIN;
+		gw_trans->action = GW_ERR;
+		gw_display_index(gw_trans, error);
+	}
 	if (gw_malloc) {
 		free(gw_trans->gw_conf->got_repos_path);
 		free(gw_trans->gw_conf->got_www_path);