diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2014-05-05 14:44:19 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2014-05-05 14:44:19 +0000 |
commit | 95525370bb791dbea12c3109386bf563c1360ad7 (patch) | |
tree | 7e61d06567dc6478be5f96133ad633432db526ce /sbin/dhclient/clparse.c | |
parent | a714dd1bfc8d73f183d5de71948d3830a0a7d5d2 (diff) |
A couple of malloc()+memset(0) -> calloc.
Diffstat (limited to 'sbin/dhclient/clparse.c')
-rw-r--r-- | sbin/dhclient/clparse.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sbin/dhclient/clparse.c b/sbin/dhclient/clparse.c index 31c1a39ce64..1632bd17ff7 100644 --- a/sbin/dhclient/clparse.c +++ b/sbin/dhclient/clparse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clparse.c,v 1.83 2014/01/25 05:21:23 krw Exp $ */ +/* $OpenBSD: clparse.c,v 1.84 2014/05/05 14:44:18 krw Exp $ */ /* Parser for dhclient config and lease files. */ @@ -454,12 +454,11 @@ parse_client_lease_statement(FILE *cfile, int is_static) return; } - lease = malloc(sizeof(struct client_lease)); + lease = calloc(1, sizeof(struct client_lease)); if (!lease) error("no memory for lease."); - memset(lease, 0, sizeof(*lease)); - lease->is_static = is_static; + lease->is_static = is_static; do { token = peek_token(NULL, cfile); if (token == EOF) { |