-/* $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. */
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) {
-/* $OpenBSD: dhclient.c,v 1.301 2014/05/04 21:07:50 krw Exp $ */
+/* $OpenBSD: dhclient.c,v 1.302 2014/05/05 14:44:18 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
char *pretty;
int i;
- lease = malloc(sizeof(struct client_lease));
+ lease = calloc(1, sizeof(struct client_lease));
if (!lease) {
warning("dhcpoffer: no memory to record lease.");
return (NULL);
}
- memset(lease, 0, sizeof(*lease));
-
/* Copy the lease options. */
for (i = 0; i < 256; i++) {
if (options[i].len == 0)