]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Save space for hostname and save hostname itself in dns_host_entry allocator.
authorTed Lemon <source@isc.org>
Fri, 6 Nov 1998 01:06:44 +0000 (01:06 +0000)
committerTed Lemon <source@isc.org>
Fri, 6 Nov 1998 01:06:44 +0000 (01:06 +0000)
common/alloc.c

index bee90959a1816b05fc5987ccd24d8522380fd534..e7317eec4414891c3b5d145934fbad1e3989d9a0 100644 (file)
@@ -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);
 }