Commit Diff


commit - a03d32e03e9fdc194f2c5b54c751f23c2d5974f6
commit + a5a8a332eeea892dc8ef463ea56eed9ae5c7c864
blob - 9dedeb9d1c3a9958da659bf80e45d36a00cb7447
blob + 1c534e627ac2c089c90c449e3637d2fcd63ff7e9
--- gotweb/gotweb.c
+++ 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);
+	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);
-		}
-
+	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);