summaryrefslogtreecommitdiffstats
path: root/usr.sbin/nscd/nscdcli.c
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2008-10-12 00:44:27 +0000
committerdelphij <delphij@FreeBSD.org>2008-10-12 00:44:27 +0000
commit43ddac3f1e8f243c83db2628113862497479ee01 (patch)
treed8f42d7789f1067ac9992f0433ed289cb38f4882 /usr.sbin/nscd/nscdcli.c
parentdd3c40ad71f19212b85b65df5edd64116a979e56 (diff)
downloadFreeBSD-src-43ddac3f1e8f243c83db2628113862497479ee01.zip
FreeBSD-src-43ddac3f1e8f243c83db2628113862497479ee01.tar.gz
Reduce code duplication: use calloc instead of allocing and memset
afterward. Approved by: bushman
Diffstat (limited to 'usr.sbin/nscd/nscdcli.c')
-rw-r--r--usr.sbin/nscd/nscdcli.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/usr.sbin/nscd/nscdcli.c b/usr.sbin/nscd/nscdcli.c
index e7459e7..c7a7931 100644
--- a/usr.sbin/nscd/nscdcli.c
+++ b/usr.sbin/nscd/nscdcli.c
@@ -201,9 +201,8 @@ open_nscd_connection__(struct nscd_connection_params const *params)
}
fcntl(client_socket, F_SETFL, O_NONBLOCK);
- retval = malloc(sizeof(struct nscd_connection_));
+ retval = calloc(1, sizeof(struct nscd_connection_));
assert(retval != NULL);
- memset(retval, 0, sizeof(struct nscd_connection_));
retval->sockfd = client_socket;
OpenPOWER on IntegriCloud