Commit b2f3ff5673dfd2ab365b9b0a6d07ea641b9a2714

Etienne Samson 2018-04-19T01:08:18

worktree: fix calloc of the wrong object type

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/worktree.c b/src/worktree.c
index 4b18db7..9152766 100644
--- a/src/worktree.c
+++ b/src/worktree.c
@@ -131,7 +131,7 @@ static int open_worktree_dir(git_worktree **out, const char *parent, const char 
 		goto out;
 	}
 
-	if ((wt = git__calloc(1, sizeof(struct git_repository))) == NULL) {
+	if ((wt = git__calloc(1, sizeof(*wt))) == NULL) {
 		error = -1;
 		goto out;
 	}