Commit Diff


commit - 774020352cebfc173153d3e48123e1ac922229a5
commit + 93088ccae4944671d38d0792e22c381cde9cc82f
blob - a6bd8e7fcfd7ed72e3721413797022a7b549fd39
blob + b38dbc844d8cdf257a5d3a9b38a75ad4955dc287
--- libexec/got-read-pack/got-read-pack.c
+++ libexec/got-read-pack/got-read-pack.c
@@ -1373,7 +1373,7 @@ enumeration_request(struct imsg *imsg, struct imsgbuf 
 
 	STAILQ_INIT(&commit_ids);
 
-	trees = calloc(1, nalloc);
+	trees = calloc(nalloc, sizeof(*trees));
 	if (trees == NULL)
 		return got_error_from_errno("calloc");