]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'rs/fast-import-simplify-mempool-allocation' into maint-2.43
authorJunio C Hamano <gitster@pobox.com>
Fri, 9 Feb 2024 00:22:10 +0000 (16:22 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 9 Feb 2024 00:22:11 +0000 (16:22 -0800)
Code simplification.

* rs/fast-import-simplify-mempool-allocation:
  fast-import: use mem_pool_calloc()

builtin/fast-import.c

index 444f41cf8ca8e6ba523f54169a3534d384094196..92eda20683ca2d07c24a03f5903d1e604ce54763 100644 (file)
@@ -2809,8 +2809,7 @@ static void parse_new_tag(const char *arg)
        enum object_type type;
        const char *v;
 
-       t = mem_pool_alloc(&fi_mem_pool, sizeof(struct tag));
-       memset(t, 0, sizeof(struct tag));
+       t = mem_pool_calloc(&fi_mem_pool, 1, sizeof(struct tag));
        t->name = mem_pool_strdup(&fi_mem_pool, arg);
        if (last_tag)
                last_tag->next_tag = t;