file_util,GetTempFileName: fix return value `nullptr` -> `std::string()`; constructing a string from a `nullptr` is undefined behavior: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/string-constructor.html Change-Id: I5d57084decc92f0e8c55c4e2c9553e2ac83d5575
diff --git a/common/file_util.cc b/common/file_util.cc index c416a52..14c5bb3 100644 --- a/common/file_util.cc +++ b/common/file_util.cc
@@ -31,7 +31,7 @@ char* temp_file_name_template = new (std::nothrow) char[temp_file_name_template_str.length() + 1]; if (!temp_file_name_template) { - return nullptr; + return std::string(); } memset(temp_file_name_template, 0, temp_file_name_template_str.length() + 1); temp_file_name_template_str.copy(temp_file_name_template,