]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
fix garbage counters in supergroup prdb_check
authorSimon Wilkinson <sxw@your-file-system.com>
Wed, 3 Apr 2013 11:09:03 +0000 (07:09 -0400)
committerStephan Wiesand <stephan.wiesand@desy.de>
Thu, 4 Apr 2013 08:17:24 +0000 (01:17 -0700)
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 <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/ptserver/db_verify.c

index 0e76765339ab03616827ea4dae9c7b0a1472984d..a07d04ea492ea1659c0f4ee6aaa11a7da077cc58 100644 (file)
@@ -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;