From: Ted Lemon Date: Fri, 6 Nov 1998 01:06:44 +0000 (+0000) Subject: Save space for hostname and save hostname itself in dns_host_entry allocator. X-Git-Tag: carrel-2~32 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0b1e0778a35ba126aa3400c01fb0f0dddb33cf02;p=thirdparty%2Fdhcp.git Save space for hostname and save hostname itself in dns_host_entry allocator. --- diff --git a/common/alloc.c b/common/alloc.c index bee90959a..e7317eec4 100644 --- a/common/alloc.c +++ b/common/alloc.c @@ -42,7 +42,7 @@ #ifndef lint static char copyright[] = -"$Id: alloc.c,v 1.16 1998/11/05 18:39:54 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; +"$Id: alloc.c,v 1.17 1998/11/06 01:06:44 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -470,17 +470,18 @@ int buffer_dereference (ptr, name) return 1; } -int dns_host_entry_allocate (ptr, name) +int dns_host_entry_allocate (ptr, hostname, name) struct dns_host_entry **ptr; char *name; { struct dns_host_entry *bp; - bp = dmalloc (sizeof *bp, name); + bp = dmalloc (strlen (hostname) + sizeof *bp, name); if (!bp) return 0; memset (bp, 0, sizeof *bp); bp -> refcnt = 0; + strcpy (bp -> hostname, hostname); return dns_host_entry_reference (ptr, bp, name); }