fix segfault in error path of 'tog diff'
diff --git a/tog/tog.c b/tog/tog.c
index 2b8c94f..fc0bb75 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -2853,7 +2853,8 @@ cmd_diff(int argc, char *argv[])
error = view_loop(view);
done:
free(repo_path);
- got_repo_close(repo);
+ if (repo)
+ got_repo_close(repo);
got_ref_list_free(&refs);
return error;
}