the `else` block below constructs a temporary std::string that destructs
at the end of the statement, leaving `filename` as a dangling view:
```
filename = file_prefix + std::string(header->get_filename());
```
store a copy of the `std::string` instead
Fixes: https://tracker.ceph.com/issues/57326
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit
e9c2ac02f1f59714677e3e1b984367df3c0ec166)
case rgw::tar::FileType::NORMAL_FILE: {
ldpp_dout(this, 2) << "handling regular file" << dendl;
- std::string_view filename;
+ std::string filename;
if (bucket_path.empty())
filename = header->get_filename();
else