summaryrefslogtreecommitdiff
path: root/builtin/blame.c
diff options
context:
space:
mode:
authorDavid Kastrup <dak@gnu.org>2014-02-08 10:19:26 +0100
committerJunio C Hamano <gitster@pobox.com>2014-02-24 14:32:41 -0800
commit62cf3ca95a7b34dcbf22d9ba4b2ea56f9fb739c9 (patch)
tree7452b1a7015b5e852b762590fd179568d484aefb /builtin/blame.c
parent0a88f08e284df1a882771f9e74133e2861b79e2d (diff)
downloadgit-62cf3ca95a7b34dcbf22d9ba4b2ea56f9fb739c9.tar.gz
builtin/blame.c::prepare_lines: fix allocation size of sb->lineno
If we are calling xrealloc on every single line, the least we can do is get the right allocation size. Signed-off-by: David Kastrup <dak@gnu.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/blame.c')
-rw-r--r--builtin/blame.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/blame.c b/builtin/blame.c
index ead614823e..9566a5ea4e 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -1763,7 +1763,7 @@ static int prepare_lines(struct scoreboard *sb)
while (len--) {
if (bol) {
sb->lineno = xrealloc(sb->lineno,
- sizeof(int *) * (num + 1));
+ sizeof(int) * (num + 1));
sb->lineno[num] = buf - sb->final_buf;
bol = 0;
}
@@ -1773,7 +1773,7 @@ static int prepare_lines(struct scoreboard *sb)
}
}
sb->lineno = xrealloc(sb->lineno,
- sizeof(int *) * (num + incomplete + 1));
+ sizeof(int) * (num + incomplete + 1));
sb->lineno[num + incomplete] = buf - sb->final_buf;
sb->num_lines = num + incomplete;
return sb->num_lines;