From: René Scharfe Date: Tue, 26 Dec 2023 08:17:45 +0000 (+0100) Subject: fast-import: use mem_pool_calloc() X-Git-Tag: v2.43.1~8^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5b7eec4bc517311f9ceb2dc7abadcc47ddc6b015;p=thirdparty%2Fgit.git fast-import: use mem_pool_calloc() 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 --- 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;