From: SZEDER Gábor Date: Tue, 12 Nov 2019 10:38:13 +0000 (+0100) Subject: name-rev: use sizeof(*ptr) instead of sizeof(type) in allocation X-Git-Tag: v2.25.0-rc0~14^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bf43abc6e6;p=thirdparty%2Fgit.git name-rev: use sizeof(*ptr) instead of sizeof(type) in allocation Signed-off-by: SZEDER Gábor Signed-off-by: Junio C Hamano --- diff --git a/builtin/name-rev.c b/builtin/name-rev.c index e40f51c2b4..7e003c2702 100644 --- a/builtin/name-rev.c +++ b/builtin/name-rev.c @@ -102,7 +102,7 @@ static void name_rev(struct commit *commit, } if (name == NULL) { - name = xmalloc(sizeof(rev_name)); + name = xmalloc(sizeof(*name)); set_commit_rev_name(commit, name); goto copy_data; } else if (is_better_name(name, taggerdate, distance, from_tag)) {