Commit Diff


commit - 370dd2e6a3e6f92f4dad349235c7b9d3f4f1a583
commit + 450db6a5ec819c2284da080ddf11a2feae97ce0c
blob - 96788ac2b7e787799fb8590028e389896022e65c
blob + 50f45ae23c5ee17f33d05cea09eb51538c343577
--- tog/tog.c
+++ tog/tog.c
@@ -3539,6 +3539,7 @@ close_log_view(struct tog_view *view)
 
 	free_commits(&s->limit_commits);
 	free_commits(&s->real_commits);
+	free_colors(&s->colors);
 	free(s->in_repo_path);
 	s->in_repo_path = NULL;
 	free(s->start_id);
@@ -3849,16 +3850,12 @@ open_log_view(struct tog_view *view, struct got_object
 			goto done;
 		err = add_color(&s->colors, "^$", TOG_COLOR_AUTHOR,
 		    get_color_value("TOG_COLOR_AUTHOR"));
-		if (err) {
-			free_colors(&s->colors);
+		if (err)
 			goto done;
-		}
 		err = add_color(&s->colors, "^$", TOG_COLOR_DATE,
 		    get_color_value("TOG_COLOR_DATE"));
-		if (err) {
-			free_colors(&s->colors);
+		if (err)
 			goto done;
-		}
 	}
 
 	view->show = show_log_view;