summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 67e22ed)
raw | patch | inline | side by side (parent: 67e22ed)
author | Alex Riesen <raa.lkml@gmail.com> | |
Sun, 22 Apr 2007 14:11:54 +0000 (16:11 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 22 Apr 2007 17:44:56 +0000 (10:44 -0700) |
Reallocated wrong size.
Noticed on Ubuntu 7.04 probably because it has some malloc diagnostics in libc:
"git-read-tree --reset -u HEAD" aborted in the test. Valgrind sped up the
debugging greatly: took me 10 minutes.
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Noticed on Ubuntu 7.04 probably because it has some malloc diagnostics in libc:
"git-read-tree --reset -u HEAD" aborted in the test. Valgrind sped up the
debugging greatly: took me 10 minutes.
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
attr.c | patch | blob | history |
index 285e689e5adff6237e179f5d64f11d3f3c09a09d..a0712543b2076a90f38d36c5ed0e8efa2639e316 100644 (file)
--- a/attr.c
+++ b/attr.c
a = parse_attr_line(line, "[builtin]", ++lineno, 1);
if (!a)
continue;
- res->attrs = xrealloc(res->attrs, res->num_matches + 1);
+ res->attrs = xrealloc(res->attrs,
+ sizeof(struct match_attr *) * (res->num_matches + 1));
res->attrs[res->num_matches++] = a;
}
return res;
a = parse_attr_line(buf, path, ++lineno, macro_ok);
if (!a)
continue;
- res->attrs = xrealloc(res->attrs, res->num_matches + 1);
+ res->attrs = xrealloc(res->attrs,
+ sizeof(struct match_attr *) * (res->num_matches + 1));
res->attrs[res->num_matches++] = a;
}
fclose(fp);