]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
[master] Clean up some memory references
authorShawn Routhier <sar@isc.org>
Thu, 25 Aug 2016 17:41:35 +0000 (10:41 -0700)
committerShawn Routhier <sar@isc.org>
Thu, 25 Aug 2016 17:41:35 +0000 (10:41 -0700)
Squashed commit of the following:

commit c3e88212ff666701b5aca3cbc96b557fa37aa682
Author: Shawn Routhier <sar@isc.org>
Date:   Wed Aug 24 11:33:31 2016 -0700

    [rt42984] Clean up some memory references

RELNOTES
server/confpars.c

index d858498662579b8fe961a8b04383d842f4df558a..07bb8d1ce6148debcbdd689ffbb2024dbce351c5 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -884,6 +884,9 @@ by Eric Young (eay@cryptsoft.com).
   interfaces will accept and forward only BOOTP requests.
   [ISC-Bugs #41547]
 
+- Clean up some memory references in the vendor-class construct.
+  [ISC-Bugs #42984]
+
                        Changes since 4.2.0 (new features)
 
 - If a client renews before 'dhcp-cache-threshold' percent of its lease
index 489ec7c4904f45a341c4b80c07980c40587d1bc9..126b3d6b49f2e638af7a0daae303cda10334999a 100644 (file)
@@ -2264,7 +2264,9 @@ int parse_class_declaration (cp, cfile, group, type)
                data.data = &data.buffer -> data [0];
                data.terminated = 1;
 
-               tname = type ? "implicit-vendor-class" : "implicit-user-class";
+               tname = (type == CLASS_TYPE_VENDOR) ?
+                 "implicit-vendor-class" : "implicit-user-class";
+
        } else if (type == CLASS_TYPE_CLASS) {
                tname = val;
        } else {
@@ -2275,7 +2277,7 @@ int parse_class_declaration (cp, cfile, group, type)
                name = dmalloc (strlen (tname) + 1, MDL);
                if (!name)
                        log_fatal ("No memory for class name %s.", tname);
-               strcpy (name, val);
+               strcpy (name, tname);
        } else
                name = NULL;