Commit a5a8a332eeea892dc8ef463ea56eed9ae5c7c864

Tracey Emery 2020-11-09T16:53:04

remove unused variable in gotweb.c, patch by Martin Vahlensieck (thanks)

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);