]> git.ipfire.org Git - thirdparty/git.git/commitdiff
name-rev: use sizeof(*ptr) instead of sizeof(type) in allocation
authorSZEDER Gábor <szeder.dev@gmail.com>
Tue, 12 Nov 2019 10:38:13 +0000 (11:38 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 6 Dec 2019 21:29:04 +0000 (13:29 -0800)
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/name-rev.c

index e40f51c2b4af414f225da5099967d6605b67d7da..7e003c2702417190a72885eb6f294847d89435d4 100644 (file)
@@ -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)) {