Skip to content

Commit bf43abc

Browse files
szedergitster
authored andcommitted
name-rev: use sizeof(*ptr) instead of sizeof(type) in allocation
Signed-off-by: SZEDER Gábor <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e0c4da6 commit bf43abc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/name-rev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ static void name_rev(struct commit *commit,
102102
}
103103

104104
if (name == NULL) {
105-
name = xmalloc(sizeof(rev_name));
105+
name = xmalloc(sizeof(*name));
106106
set_commit_rev_name(commit, name);
107107
goto copy_data;
108108
} else if (is_better_name(name, taggerdate, distance, from_tag)) {

0 commit comments

Comments
 (0)