diff options
author | delphij <delphij@FreeBSD.org> | 2011-07-14 07:35:28 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2011-07-14 07:35:28 +0000 |
commit | ab777938ae6369a3680885303b4b6a5e6dbe850e (patch) | |
tree | 1d96800fce9a72b38cc66c2a587c2a92175b48d8 /usr.sbin | |
parent | 8337fe7e3efadbf357463f1f54b95df539af127d (diff) | |
download | FreeBSD-src-ab777938ae6369a3680885303b4b6a5e6dbe850e.zip FreeBSD-src-ab777938ae6369a3680885303b4b6a5e6dbe850e.tar.gz |
Use calloc() instead of an explicit memset.
MFC after: 2 weeks
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/mountd/mountd.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index 01a27eb..a1e83c3 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -1789,10 +1789,9 @@ get_exp(void) { struct exportlist *ep; - ep = (struct exportlist *)malloc(sizeof (struct exportlist)); + ep = (struct exportlist *)calloc(1, sizeof (struct exportlist)); if (ep == (struct exportlist *)NULL) out_of_mem(); - memset(ep, 0, sizeof(struct exportlist)); return (ep); } @@ -1804,10 +1803,9 @@ get_grp(void) { struct grouplist *gp; - gp = (struct grouplist *)malloc(sizeof (struct grouplist)); + gp = (struct grouplist *)calloc(1, sizeof (struct grouplist)); if (gp == (struct grouplist *)NULL) out_of_mem(); - memset(gp, 0, sizeof(struct grouplist)); return (gp); } |