diff options
| author | Junio C Hamano <gitster@pobox.com> | 2020-02-14 12:54:23 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2020-02-14 12:54:23 -0800 |
| commit | aa21cc97bd10ab0b62f6d951ff2ff725261e326e (patch) | |
| tree | 69e983408fd1a4f599ea00d6b70599a00282be06 /walker.c | |
| parent | 883326077a1995a5ea122c298ff47fcd85782c49 (diff) | |
| parent | 5290d4513496d89f84570985a0e02e97dff477ff (diff) | |
| download | git-aa21cc97bd10ab0b62f6d951ff2ff725261e326e.tar.gz | |
Merge branch 'jk/alloc-cleanups'
Misc code clean-ups.
* jk/alloc-cleanups:
tree-walk.c: break circular dependency with unpack-trees
traverse_trees(): use stack array for name entries
walker_fetch(): avoid raw array length computation
normalize_path_copy(): document "dst" size expectations
Diffstat (limited to 'walker.c')
| -rw-r--r-- | walker.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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) { |
