Commit ef2a1e11cfd5e1e90e183fca027e98221720ba7e

Stefan Sperling 2019-05-07T20:30:05

fix another segfault

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/lib/worktree.c b/lib/worktree.c
index 7e7c1b8..3354651 100644
--- a/lib/worktree.c
+++ b/lib/worktree.c
@@ -2483,7 +2483,8 @@ done:
 	}
 	got_object_idset_free(tree_ids);
 	got_pathlist_free(&paths);
-	got_object_tree_close(base_tree);
+	if (base_tree)
+		got_object_tree_close(base_tree);
 	free(relpath);
 	return err;
 }