From: David Hankins Date: Tue, 27 Mar 2007 02:47:27 +0000 (+0000) Subject: - A reference leak on binding scopes set by ddns updates was repaired. X-Git-Tag: v4_0_0a1~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75ab3070cc989e31b93b77e46fa8a2f4703458e8;p=thirdparty%2Fdhcp.git - A reference leak on binding scopes set by ddns updates was repaired. [ISC-Bugs #16769] --- diff --git a/RELNOTES b/RELNOTES index 306aaa7fb..f7695797a 100644 --- 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 diff --git a/server/ddns.c b/server/ddns.c index 6323056f0..b3b71d80c 100644 --- a/server/ddns.c +++ b/server/ddns.c @@ -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,