2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-08-31 14:25:41 +00:00

Fix some uninitialized objects.

This commit is contained in:
Ted Lemon
1999-09-15 19:47:38 +00:00
parent 8a6dfe4c4b
commit 2d92095d6e
4 changed files with 9 additions and 5 deletions

View File

@@ -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);

View File

@@ -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;

View File

@@ -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;

View File

@@ -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");