From 65ae1315891e4c4802b82bdeceea40d20865a648 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Wed, 3 Apr 2013 07:09:03 -0400 Subject: [PATCH] fix garbage counters in supergroup prdb_check This is a backport of one hunk of commit 9efc255ab8de7ad90c7d599fea7bd1956bfd48c2, where a calloc fixes an incorrectly sized memset. The original memset clears the size of the pointer, not the sizeof the structure. Change-Id: I40250e0346345fe9b4b43d14e76ea5fb23c8c04b Reviewed-on: http://gerrit.openafs.org/9701 Reviewed-by: Andrew Deason Tested-by: BuildBot Reviewed-by: Stephan Wiesand --- src/ptserver/db_verify.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ptserver/db_verify.c b/src/ptserver/db_verify.c index 0e7676533..a07d04ea4 100644 --- a/src/ptserver/db_verify.c +++ b/src/ptserver/db_verify.c @@ -1486,12 +1486,11 @@ inccount(struct idused **idmapp, int id) idmapp = &idmap->idnext; } if (!idmap) { - idmap = (struct idused *)malloc(sizeof *idmap); + idmap = calloc(1, sizeof *idmap); if (!idmap) { perror("idmap"); exit(1); } - memset(idmap, 0, sizeof idmap); idmap->idstart = id & ~(IDCOUNT - 1); idmap->idnext = *idmapp; *idmapp = idmap; -- 2.39.5