libacl: use initialized memory
authorArne Wiebalck <Arne.Wiebalck@cern.ch>
Fri, 7 Feb 2014 11:37:57 +0000 (12:37 +0100)
committerJeffrey Altman <jaltman@your-file-system.com>
Sat, 8 Feb 2014 15:01:20 +0000 (07:01 -0800)
Replace malloc with calloc to use zeroed memory when converting access
lists.

Change-Id: I17558d1737fee020772919e423c9fba37180beca
Reviewed-on: http://gerrit.openafs.org/10815
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

src/libacl/aclprocs.c

index d963c78..d4c3f8c 100644 (file)
@@ -253,7 +253,7 @@ acl_Internalize_pr(int (*func)(namelist *names, idlist *ids), char *elist, struc
        return 0;
     }
     lnames.namelist_len = (*acl)->total;
-    lnames.namelist_val = malloc(lnames.namelist_len * PR_MAXNAMELEN);
+    lnames.namelist_val = calloc(lnames.namelist_len, PR_MAXNAMELEN);
     if (lnames.namelist_val == 0) {
        return -1;
     }