name-rev: use sizeof(*ptr) instead of sizeof(type) in allocation
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
SZEDER Gábor committed
Nov 12, 2019 at 11:38 UTC
bf43abc6e60fc9732a287f529a6cedcbdfe2a74c
1 file changed
+1
-1
builtin/name-rev.c
+1
-1
@@ -102,7 +102,7 @@ static void name_rev(struct commit *commit,
102
}
103
104
if (name == NULL) {
105
- name = xmalloc(sizeof(rev_name));
105
+ name = xmalloc(sizeof(*name));
106
set_commit_rev_name(commit, name);
107
goto copy_data;
108
} else if (is_better_name(name, taggerdate, distance, from_tag)) {