From 7abe9655d305390257d01b666590eccdc53d24e3 Mon Sep 17 00:00:00 2001 From: sdong Date: Wed, 6 Aug 2014 17:37:35 -0700 Subject: [PATCH] Fix valgrind failure caused by recent checked-in. Summary: Initialize un-initialized parameters Test Plan: run the failed test (c_test) Reviewers: yhchiang, ljin Reviewed By: ljin Subscribers: leveldb Differential Revision: https://reviews.facebook.net/D21249 --- db/db_impl.cc | 8 ++++---- db/internal_stats.cc | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/db/db_impl.cc b/db/db_impl.cc index 3fedfac3e..5cfbc2e05 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -4353,8 +4353,8 @@ const Options& DBImpl::GetOptions(ColumnFamilyHandle* column_family) const { bool DBImpl::GetProperty(ColumnFamilyHandle* column_family, const Slice& property, std::string* value) { - bool is_int_property; - bool need_out_of_mutex; + bool is_int_property = false; + bool need_out_of_mutex = false; DBPropertyType property_type = GetPropertyType(property, &is_int_property, &need_out_of_mutex); @@ -4378,8 +4378,8 @@ bool DBImpl::GetProperty(ColumnFamilyHandle* column_family, bool DBImpl::GetIntProperty(ColumnFamilyHandle* column_family, const Slice& property, uint64_t* value) { - bool is_int_property; - bool need_out_of_mutex; + bool is_int_property = false; + bool need_out_of_mutex = false; DBPropertyType property_type = GetPropertyType(property, &is_int_property, &need_out_of_mutex); if (!is_int_property) { diff --git a/db/internal_stats.cc b/db/internal_stats.cc index 790eb8723..ef0c58ff8 100644 --- a/db/internal_stats.cc +++ b/db/internal_stats.cc @@ -93,10 +93,10 @@ DBPropertyType GetPropertyType(const Slice& property, bool* is_int_property, Slice in = property; Slice prefix("rocksdb."); *need_out_of_mutex = false; + *is_int_property = false; if (!in.starts_with(prefix)) return kUnknown; in.remove_prefix(prefix.size()); - *is_int_property = false; if (in.starts_with("num-files-at-level")) { return kNumFilesAtLevel; } else if (in == "levelstats") {