Commit 8122ef98538eea82be7007ee664ef28e474ce79f

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 b15cd53..2bfb1ab 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;
 	}