Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
builtin/blame.c::prepare_lines: fix allocation size of sb->lineno
author
David Kastrup
<dak@gnu.org>
Sat, 8 Feb 2014 09:19:26 +0000
(10:19 +0100)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 24 Feb 2014 22:32:41 +0000
(14:32 -0800)
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>
builtin/blame.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
0a88f08
)
diff --git
a/builtin/blame.c
b/builtin/blame.c
index ead614823eae473dbba1cdb1fa5d094be2e41bbe..9566a5ea4eabcdf83af46032283fa6ede426bca0 100644
(file)
--- 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;