diff --git a/util/auto_roll_logger_test.cc b/util/auto_roll_logger_test.cc index 4b5bc82438..3cf9cb453f 100755 --- a/util/auto_roll_logger_test.cc +++ b/util/auto_roll_logger_test.cc @@ -244,8 +244,9 @@ TEST(AutoRollLoggerTest, InfoLogLevel) { const int kInfoLogLevelNameLens[5] = {5, 4, 4, 5, 5}; size_t log_size = 8192; - AutoRollLogger* logger = - new AutoRollLogger(Env::Default(), kTestDir, "", log_size, 0); + std::unique_ptr logger_guard( + new AutoRollLogger(Env::Default(), kTestDir, "", log_size, 0)); + auto logger = logger_guard.get(); int message_length = kSampleMessage.length(); int log_length = 0;