Commit 47112f6094edb866f5f668554c53348bc427ac35

Stefan Sperling 2019-03-11T19:32:21

fix allocation size bug in got_lockfile_lock()

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/lockfile.c b/lib/lockfile.c
index 5fb38e7..97ae4bc 100644
--- a/lib/lockfile.c
+++ b/lib/lockfile.c
@@ -37,7 +37,7 @@ got_lockfile_lock(struct got_lockfile **lf, const char *path)
 	const int flags = O_RDONLY | O_CREAT | O_EXCL | O_EXLOCK;
 	int attempts = 5;
 
-	*lf = calloc(1, sizeof(*lf));
+	*lf = calloc(1, sizeof(**lf));
 	if (*lf == NULL)
 		return got_error_from_errno();
 	(*lf)->fd = -1;