From: Marcin Siodelski Date: Tue, 13 Sep 2016 13:07:57 +0000 (+0200) Subject: [3161] Explicitly initialize uninitialized variables. X-Git-Tag: trac5006_base~2^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97ae6373fb97788ebd93f4ca0d68632127537e0c;p=thirdparty%2Fkea.git [3161] Explicitly initialize uninitialized variables. Reported by cpp-check. --- diff --git a/src/lib/dhcpsrv/mysql_lease_mgr.cc b/src/lib/dhcpsrv/mysql_lease_mgr.cc index 9fa1994e8d..262c0d68fd 100644 --- a/src/lib/dhcpsrv/mysql_lease_mgr.cc +++ b/src/lib/dhcpsrv/mysql_lease_mgr.cc @@ -1240,10 +1240,11 @@ public: MySqlLeaseStatsQuery(MySqlConnection& conn, const size_t statement_index, const bool fetch_type) : conn_(conn), statement_index_(statement_index), statement_(NULL), - fetch_type_(fetch_type), - // Set the number of columns in the bind array based on fetch_type - // This is the number of columns expected in the result set - bind_(fetch_type_ ? 4 : 3) { + fetch_type_(fetch_type), + // Set the number of columns in the bind array based on fetch_type + // This is the number of columns expected in the result set + bind_(fetch_type_ ? 4 : 3), + subnet_id_(0), lease_type_(0), lease_state_(0), state_count_(0) { if (statement_index_ >= MySqlLeaseMgr::NUM_STATEMENTS) { isc_throw(BadValue, "MySqlLeaseStatsQuery" " - invalid statement index" << statement_index_); diff --git a/src/lib/dhcpsrv/pgsql_host_data_source.cc b/src/lib/dhcpsrv/pgsql_host_data_source.cc index 732db7cf1d..6f1e43a3f3 100644 --- a/src/lib/dhcpsrv/pgsql_host_data_source.cc +++ b/src/lib/dhcpsrv/pgsql_host_data_source.cc @@ -1020,7 +1020,8 @@ public: /// @brief Constructor. PgSqlOptionExchange() - : PgSqlExchange(OPTION_COLUMNS) { + : PgSqlExchange(OPTION_COLUMNS), value_(), + value_len_(0), option_() { columns_[OPTION_ID_COL] = "option_id"; columns_[CODE_COL] = "code"; columns_[VALUE_COL] = "value";