Commit 0845193829e4f95dfff0f61aea907b88537b5a66

Stefan Sperling 2018-11-05T23:23:23

no need to zero path during allocation in get_packfile_path()

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/object.c b/lib/object.c
index 166807b..2100b96 100644
--- a/lib/object.c
+++ b/lib/object.c
@@ -153,7 +153,7 @@ get_packfile_path(char **path_packfile, struct got_packidx *packidx)
 	if (size < GOT_PACKFILE_NAMELEN + 1)
 		return got_error(GOT_ERR_BAD_PATH);
 
-	*path_packfile = calloc(size, sizeof(**path_packfile));
+	*path_packfile = malloc(size);
 	if (*path_packfile == NULL)
 		return got_error_from_errno();