]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
- A reference leak on binding scopes set by ddns updates was repaired.
authorDavid Hankins <dhankins@isc.org>
Tue, 27 Mar 2007 02:47:27 +0000 (02:47 +0000)
committerDavid Hankins <dhankins@isc.org>
Tue, 27 Mar 2007 02:47:27 +0000 (02:47 +0000)
  [ISC-Bugs #16769]

RELNOTES
server/ddns.c

index 306aaa7fbc03d2fae8555afb4f4fff61bb765aa3..f7695797aaa63fac3bef087f0bee62c0048510fd 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -193,6 +193,8 @@ the README file.
   incorrectly indicating 'up' state when any flags were set, rather than
   specifically the INTERFACE_REQUESTED flag.
 
+- A reference leak on binding scopes set by ddns updates was repaired.
+
                         Changes since 3.0.5rc1
 
 - A bug was repaired in fixes to the dhclient, which sought to run the
index 6323056f099ed7f2c18029eeadf1a09436206bf1..b3b71d80c5e27121c61f4ac681944987519a37f1 100644 (file)
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: ddns.c,v 1.23 2006/08/02 22:36:00 dhankins Exp $ Copyright (c) 2004-2005 Internet Systems Consortium.  All rights reserved.\n";
+"$Id: ddns.c,v 1.24 2007/03/27 02:47:27 dhankins Exp $ Copyright (c) 2004-2005 Internet Systems Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -399,7 +399,8 @@ int ddns_updates (struct packet *packet,
                                /* Now, install the DDNS data the new way. */
                                goto in;
                        }
-               }
+               } else
+                       data_string_forget(&ddns_dhcid, MDL);
 
                /* See if the administrator wants to do updates even
                   in cases where the update already appears to have been
@@ -414,15 +415,12 @@ int ddns_updates (struct packet *packet,
                        result = 1;
                        goto noerror;
                }
-       }
-
-       /* If there's no ddns-fwd-name on the lease, see if there's
-          a ddns-client-fqdn, indicating a prior client FQDN update.
-          If there is, and if we're still doing the client update,
-          see if the name has changed.   If it hasn't, don't do the
-          PTR update. */
-       if (find_bound_string (&old_ddns_fwd_name,
-                              lease -> scope, "ddns-client-fqdn")) {
+       /* If there's no "ddns-fwd-name" on the lease record, see if
+        * there's a ddns-client-fqdn indicating a previous client
+        * update (if it changes, we need to adjust the PTR).
+        */
+       } else if (find_bound_string(&old_ddns_fwd_name, lease->scope,
+                                    "ddns-client-fqdn")) {
                /* If the name is not different, no need to update
                   the PTR record. */
                if (old_ddns_fwd_name.len == ddns_fwd_name.len &&
@@ -520,7 +518,6 @@ int ddns_updates (struct packet *packet,
         * If we are updating the A record, compute the DHCID value.
         */
        if (server_updates_a) {
-               memset (&ddns_dhcid, 0, sizeof ddns_dhcid);
                if (lease -> uid && lease -> uid_len)
                        result = get_dhcid (&ddns_dhcid,
                                            DHO_DHCP_CLIENT_IDENTIFIER,
@@ -563,7 +560,7 @@ int ddns_updates (struct packet *packet,
                rcode1 = ddns_update_a (&ddns_fwd_name, lease -> ip_addr,
                                        &ddns_dhcid, ddns_ttl, 0, conflict);
        }
-       
+
        if (rcode1 == ISC_R_SUCCESS) {
                if (ddns_fwd_name.len && ddns_rev_name.len)
                        rcode2 = ddns_update_ptr (&ddns_fwd_name,