@matheusbsbs / matheus-bagliano / commits / 5e2b0636c7
Fork 0

Don't xcalloc() struct diffstat_t

Signed-off-by: Timo Hirvonen <tihirvon@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>

Timo Hirvonen committed Jun 25, 2006 at 14:28 UTC 5e2b0636c709884e45ef941cd4514c225f204982
1 file changed +5 -6
diff.c
+5 -6
@@ -2115,17 +2115,16 @@ void diff_flush(struct diff_options *options)
2115 }
2116
2117 if (output_format & DIFF_FORMAT_DIFFSTAT) {
2118 - struct diffstat_t *diffstat;
2118 + struct diffstat_t diffstat;
2119
2120 - diffstat = xcalloc(sizeof (struct diffstat_t), 1);
2121 - diffstat->xm.consume = diffstat_consume;
2120 + memset(&diffstat, 0, sizeof(struct diffstat_t));
2121 + diffstat.xm.consume = diffstat_consume;
2122 for (i = 0; i < q->nr; i++) {
2123 struct diff_filepair *p = q->queue[i];
2124 if (check_pair_status(p))
2125 - diff_flush_stat(p, options, diffstat);
2125 + diff_flush_stat(p, options, &diffstat);
2126 }
2127 - show_stats(diffstat);
2128 - free(diffstat);
2127 + show_stats(&diffstat);
2128 }
2129
2130 if (output_format & DIFF_FORMAT_SUMMARY) {