remove unused variable in gotweb.c, patch by Martin Vahlensieck (thanks)
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 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
diff --git a/gotweb/gotweb.c b/gotweb/gotweb.c
index 9dedeb9..1c534e6 100644
--- a/gotweb/gotweb.c
+++ b/gotweb/gotweb.c
@@ -4679,7 +4679,6 @@ main(int argc, char *argv[])
struct gw_trans *gw_trans;
struct gw_dir *dir = NULL, *tdir;
const char *page = "index";
- int gw_malloc = 1;
enum kcgi_err kerr = KCGI_OK;
if ((gw_trans = malloc(sizeof(struct gw_trans))) == NULL)
@@ -4732,33 +4731,30 @@ main(int argc, char *argv[])
else
error = gw_display_index(gw_trans);
done:
- if (gw_malloc) {
- free(gw_trans->gw_conf->got_repos_path);
- free(gw_trans->gw_conf->got_www_path);
- free(gw_trans->gw_conf->got_site_name);
- free(gw_trans->gw_conf->got_site_owner);
- free(gw_trans->gw_conf->got_site_link);
- free(gw_trans->gw_conf->got_logo);
- free(gw_trans->gw_conf->got_logo_url);
- free(gw_trans->gw_conf);
- free(gw_trans->commit_id);
- free(gw_trans->next_id);
- free(gw_trans->next_prev_id);
- free(gw_trans->prev_id);
- free(gw_trans->prev_prev_id);
- free(gw_trans->repo_path);
- if (gw_trans->repo)
- got_repo_close(gw_trans->repo);
-
- TAILQ_FOREACH_SAFE(dir, &gw_trans->gw_dirs, entry, tdir) {
- free(dir->name);
- free(dir->description);
- free(dir->age);
- free(dir->url);
- free(dir->path);
- free(dir);
- }
-
+ free(gw_trans->gw_conf->got_repos_path);
+ free(gw_trans->gw_conf->got_www_path);
+ free(gw_trans->gw_conf->got_site_name);
+ free(gw_trans->gw_conf->got_site_owner);
+ free(gw_trans->gw_conf->got_site_link);
+ free(gw_trans->gw_conf->got_logo);
+ free(gw_trans->gw_conf->got_logo_url);
+ free(gw_trans->gw_conf);
+ free(gw_trans->commit_id);
+ free(gw_trans->next_id);
+ free(gw_trans->next_prev_id);
+ free(gw_trans->prev_id);
+ free(gw_trans->prev_prev_id);
+ free(gw_trans->repo_path);
+ if (gw_trans->repo)
+ got_repo_close(gw_trans->repo);
+
+ TAILQ_FOREACH_SAFE(dir, &gw_trans->gw_dirs, entry, tdir) {
+ free(dir->name);
+ free(dir->description);
+ free(dir->age);
+ free(dir->url);
+ free(dir->path);
+ free(dir);
}
khttp_free(gw_trans->gw_req);