Commit 70ac5f8404f46cd2a9d3cb6c34cb89e61c76df1f

Stefan Sperling 2019-03-29T06:49:25

more init fixes for ref lists in tog

diff --git a/tog/tog.c b/tog/tog.c
index 998a4ef..6a5d797 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -2462,6 +2462,8 @@ cmd_diff(int argc, char *argv[])
 	int ch;
 	struct tog_view *view;
 
+	SIMPLEQ_INIT(&refs);
+
 #ifndef PROFILE
 	if (pledge("stdio rpath wpath cpath flock proc tty exec sendfd unveil",
 	    NULL) == -1)
@@ -2515,7 +2517,6 @@ cmd_diff(int argc, char *argv[])
 	if (error)
 		goto done;
 
-	SIMPLEQ_INIT(&refs);
 	error = got_ref_list(&refs, repo);
 	if (error)
 		goto done;
@@ -3181,6 +3182,8 @@ cmd_blame(int argc, char *argv[])
 	int ch;
 	struct tog_view *view;
 
+	SIMPLEQ_INIT(&refs);
+
 #ifndef PROFILE
 	if (pledge("stdio rpath wpath cpath flock proc tty exec sendfd unveil",
 	    NULL) == -1)
@@ -3281,7 +3284,6 @@ cmd_blame(int argc, char *argv[])
 	if (error != NULL)
 		goto done;
 
-	SIMPLEQ_INIT(&refs);
 	error = got_ref_list(&refs, repo);
 	if (error)
 		goto done;
@@ -3858,6 +3860,8 @@ cmd_tree(int argc, char *argv[])
 	int ch;
 	struct tog_view *view;
 
+	SIMPLEQ_INIT(&refs);
+
 #ifndef PROFILE
 	if (pledge("stdio rpath wpath cpath flock proc tty exec sendfd unveil",
 	    NULL) == -1)
@@ -3931,7 +3935,6 @@ cmd_tree(int argc, char *argv[])
 	if (error != NULL)
 		goto done;
 
-	SIMPLEQ_INIT(&refs);
 	error = got_ref_list(&refs, repo);
 	if (error)
 		goto done;