aboutsummaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorTimo Hirvonen <tihirvon@gmail.com>2006-06-25 14:28:19 +0300
committerJunio C Hamano <junkio@cox.net>2006-06-26 14:58:41 -0700
commit5e2b0636c709884e45ef941cd4514c225f204982 (patch)
treeea6c80a476ce6fef7b8dc38b7fc15b1299d499d2 /diff.c
parent39bc9a6c2051a9fc31dc9b34b40bdd3dd94a8afb (diff)
downloadgit-5e2b0636c709884e45ef941cd4514c225f204982.tar.gz
git-5e2b0636c709884e45ef941cd4514c225f204982.tar.xz
Don't xcalloc() struct diffstat_t
Signed-off-by: Timo Hirvonen <tihirvon@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/diff.c b/diff.c
index 491b846f6..54698f511 100644
--- a/diff.c
+++ b/diff.c
@@ -2115,17 +2115,16 @@ void diff_flush(struct diff_options *options)
}
if (output_format & DIFF_FORMAT_DIFFSTAT) {
- struct diffstat_t *diffstat;
+ struct diffstat_t diffstat;
- diffstat = xcalloc(sizeof (struct diffstat_t), 1);
- diffstat->xm.consume = diffstat_consume;
+ memset(&diffstat, 0, sizeof(struct diffstat_t));
+ diffstat.xm.consume = diffstat_consume;
for (i = 0; i < q->nr; i++) {
struct diff_filepair *p = q->queue[i];
if (check_pair_status(p))
- diff_flush_stat(p, options, diffstat);
+ diff_flush_stat(p, options, &diffstat);
}
- show_stats(diffstat);
- free(diffstat);
+ show_stats(&diffstat);
}
if (output_format & DIFF_FORMAT_SUMMARY) {