xdiff: fix merging of appended hunk with -W
[gitweb.git] / notes.c
diff --git a/notes.c b/notes.c
index c1e503559076398b1edc5fabbaab8f3cac5ac7d6..88cf4747c16724931682e606a2c1fba4c07b2f49 100644 (file)
--- a/notes.c
+++ b/notes.c
@@ -1035,7 +1035,7 @@ struct notes_tree **load_notes_trees(struct string_list *refs, int flags)
        struct string_list_item *item;
        int counter = 0;
        struct notes_tree **trees;
-       trees = xmalloc((refs->nr+1) * sizeof(struct notes_tree *));
+       ALLOC_ARRAY(trees, refs->nr + 1);
        for_each_string_list_item(item, refs) {
                struct notes_tree *t = xcalloc(1, sizeof(struct notes_tree));
                init_notes(t, item->string, combine_notes_ignore, flags);