Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 10bf49f4 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix stack-use-after-scope for a `std::string`"

parents 2b6bae00 eb39a511
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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));