Commit 2d92095d authored by Ted Lemon's avatar Ted Lemon
Browse files

Fix some uninitialized objects.

parent 8a6dfe4c
......@@ -22,7 +22,7 @@
#ifndef lint
static char copyright[] =
"$Id: discover.c,v 1.13 1999/09/09 23:26:11 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
"$Id: discover.c,v 1.14 1999/09/15 19:47:27 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
......@@ -149,6 +149,7 @@ void discover_interfaces (state)
if (!tmp)
log_fatal ("Insufficient memory to %s %s",
"record interface", ifp -> ifr_name);
memset (tmp, 0, sizeof *tmp);
strcpy (tmp -> name, ifp -> ifr_name);
tmp -> circuit_id = (u_int8_t *)tmp -> name;
tmp -> circuit_id_len = strlen (tmp -> name);
......
......@@ -22,7 +22,7 @@
#ifndef lint
static char copyright[] =
"$Id: memory.c,v 1.56 1999/09/09 23:26:36 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
"$Id: memory.c,v 1.57 1999/09/15 19:47:27 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
......@@ -458,7 +458,8 @@ void new_address_range (low, high, subnet, pool)
if (!address_range) {
strcpy (lowbuf, piaddr (low));
strcpy (highbuf, piaddr (high));
log_fatal ("No memory for address range %s-%s.", lowbuf, highbuf);
log_fatal ("No memory for address range %s-%s.",
lowbuf, highbuf);
}
memset (address_range, 0, (sizeof *address_range) * (max - min + 1));
......@@ -635,6 +636,7 @@ void enter_lease (lease)
log_fatal ("No memory for lease %s\n",
piaddr (lease -> ip_addr));
}
memset (comp, 0, sizeof *comp);
*comp = *lease;
comp -> next = dangling_leases;
comp -> prev = (struct lease *)0;
......
......@@ -130,6 +130,7 @@ isc_result_t omapi_accept (omapi_object_t *h)
obj = (omapi_connection_object_t *)malloc (sizeof *obj);
if (!obj)
return ISC_R_NOMEMORY;
memset (obj, 0, sizeof *obj);
obj -> refcnt = 1;
obj -> type = omapi_type_connection;
......
......@@ -22,7 +22,7 @@
#ifndef lint
static char copyright[] =
"$Id: confpars.c,v 1.79 1999/09/09 23:32:22 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
"$Id: confpars.c,v 1.80 1999/09/15 19:47:38 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
......@@ -915,7 +915,7 @@ void parse_host_declaration (cfile, group)
"parse_host_declaration");
if (!host)
log_fatal ("can't allocate host decl struct %s.", name);
memset (host, 0, sizeof *host);
host -> name = name;
host -> group = clone_group (group, "parse_host_declaration");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment