Merge "Fix stack-use-after-scope for a std::string"
This commit is contained in:
committed by
Android (Google) Code Review
commit
10bf49f4be
@@ -43,8 +43,9 @@ namespace ResourceUtils {
|
||||
static std::optional<ResourceNamedType> ToResourceNamedType(const char16_t* type16,
|
||||
const char* type, size_t type_len) {
|
||||
std::optional<ResourceNamedTypeRef> parsed_type;
|
||||
std::string converted;
|
||||
if (type16) {
|
||||
auto converted = android::util::Utf16ToUtf8(StringPiece16(type16, type_len));
|
||||
converted = android::util::Utf16ToUtf8(StringPiece16(type16, type_len));
|
||||
parsed_type = ParseResourceNamedType(converted);
|
||||
} else if (type) {
|
||||
parsed_type = ParseResourceNamedType(StringPiece(type, type_len));
|
||||
|
||||
Reference in New Issue
Block a user