BIND 10 trac3232, updated. 8ae73d0c674b4bd641d1323c447c19f9f255be0c [3232] Initialize all values in Lease6 in the default constructor.

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Mar 12 17:35:51 UTC 2014


The branch, trac3232 has been updated
       via  8ae73d0c674b4bd641d1323c447c19f9f255be0c (commit)
      from  58de1eed517805118a5d883caf88a2fe951d0dc9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 8ae73d0c674b4bd641d1323c447c19f9f255be0c
Author: Marcin Siodelski <marcin at isc.org>
Date:   Wed Mar 12 18:35:35 2014 +0100

    [3232] Initialize all values in Lease6 in the default constructor.
    
    Failing to initialize all values causes valgrind errors.

-----------------------------------------------------------------------

Summary of changes:
 src/lib/dhcpsrv/lease.cc |    8 +++++++-
 src/lib/dhcpsrv/lease.h  |    5 +----
 2 files changed, 8 insertions(+), 5 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/dhcpsrv/lease.cc b/src/lib/dhcpsrv/lease.cc
index 7bc71f9..159cda5 100644
--- a/src/lib/dhcpsrv/lease.cc
+++ b/src/lib/dhcpsrv/lease.cc
@@ -166,6 +166,12 @@ Lease6::Lease6(Type type, const isc::asiolink::IOAddress& addr,
     cltt_ = time(NULL);
 }
 
+Lease6::Lease6()
+    : Lease(isc::asiolink::IOAddress("::"), 0, 0, 0, 0, 0, false, false, ""),
+      type_(TYPE_NA), prefixlen_(0), iaid_(0), duid_(DuidPtr()),
+      preferred_lft_(0) {
+}
+
 const std::vector<uint8_t>&
 Lease6::getDuidVector() const {
     if (!duid_) {
@@ -180,7 +186,7 @@ std::string
 Lease6::toText() const {
     ostringstream stream;
 
-    stream << "Type:          " << typeToText(type_) << "(" 
+    stream << "Type:          " << typeToText(type_) << "("
            << static_cast<int>(type_) << ") ";
     stream << "Address:       " << addr_ << "\n"
            << "Prefix length: " << static_cast<int>(prefixlen_) << "\n"
diff --git a/src/lib/dhcpsrv/lease.h b/src/lib/dhcpsrv/lease.h
index c767142..a8f4527 100644
--- a/src/lib/dhcpsrv/lease.h
+++ b/src/lib/dhcpsrv/lease.h
@@ -348,10 +348,7 @@ struct Lease6 : public Lease {
     /// @brief Constructor
     ///
     /// Initialize fields that don't have a default constructor.
-    Lease6() : Lease(isc::asiolink::IOAddress("::"), 0, 0, 0, 0, 0,
-                     false, false, ""),
-        type_(TYPE_NA) {
-    }
+    Lease6();
 
     /// @brief Returns a reference to a vector representing a DUID.
     ///



More information about the bind10-changes mailing list