[CRIU] [PATCH] stats: Properly initialize dump stats

Pavel Emelyanov xemul at parallels.com
Wed Aug 6 04:38:50 PDT 2014


They all should be zeroed.

Signed-off-by: Pavel Emelyanov <xemul at parallels.com>

---
 stats.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/stats.c b/stats.c
index 0171215..011c359 100644
--- a/stats.c
+++ b/stats.c
@@ -148,7 +148,7 @@ void write_stats(int what)
 int init_stats(int what)
 {
 	if (what == DUMP_STATS) {
-		dstats = xmalloc(sizeof(*dstats));
+		dstats = xzalloc(sizeof(*dstats));
 		return dstats ? 0 : -1;
 	}
 
-- 
1.8.4.2



More information about the CRIU mailing list