From 5b7eec4bc517311f9ceb2dc7abadcc47ddc6b015 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Tue, 26 Dec 2023 09:17:45 +0100 Subject: fast-import: use mem_pool_calloc() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use mem_pool_calloc() to get a zeroed buffer instead of zeroing it ourselves. This makes the code clearer and less repetitive. Signed-off-by: René Scharfe Signed-off-by: Junio C Hamano --- builtin/fast-import.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/builtin/fast-import.c b/builtin/fast-import.c index 444f41cf8c..92eda20683 100644 --- a/builtin/fast-import.c +++ b/builtin/fast-import.c @@ -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; -- cgit v1.2.3