more init fixes for ref lists in tog
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
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;