summaryrefslogtreecommitdiff
path: root/walker.c
diff options
context:
space:
mode:
Diffstat (limited to 'walker.c')
-rw-r--r--walker.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/walker.c b/walker.c
index 06cd2bd569..bb010f7a2b 100644
--- a/walker.c
+++ b/walker.c
@@ -261,12 +261,14 @@ int walker_fetch(struct walker *walker, int targets, char **target,
struct strbuf refname = STRBUF_INIT;
struct strbuf err = STRBUF_INIT;
struct ref_transaction *transaction = NULL;
- struct object_id *oids = xmalloc(targets * sizeof(struct object_id));
+ struct object_id *oids;
char *msg = NULL;
int i, ret = -1;
save_commit_buffer = 0;
+ ALLOC_ARRAY(oids, targets);
+
if (write_ref) {
transaction = ref_transaction_begin(&err);
if (!transaction) {