diff --git a/src/bvar/default_variables.cpp b/src/bvar/default_variables.cpp index be02c50a9a..011508aa0e 100644 --- a/src/bvar/default_variables.cpp +++ b/src/bvar/default_variables.cpp @@ -127,7 +127,7 @@ static bool read_proc_status(ProcStat &stat) { template class CachedReader { public: - CachedReader() : _mtime_us(0) { + CachedReader() : _mtime_us(0), _cached{} { CHECK_EQ(0, pthread_mutex_init(&_mutex, NULL)); } ~CachedReader() { @@ -150,7 +150,7 @@ class CachedReader { pthread_mutex_unlock(&p->_mutex); // don't run fn inside lock otherwise a slow fn may // block all concurrent bvar dumppers. (e.g. /vars) - T result; + T result{}; if (fn(&result)) { pthread_mutex_lock(&p->_mutex); p->_cached = result;