get rid of a goto in gotweb that jumped upwards rather than down
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
diff --git a/gotweb/gotweb.c b/gotweb/gotweb.c
index 8cc8ff9..060b7e0 100644
--- a/gotweb/gotweb.c
+++ b/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);