]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rgw: avoid string_view to temporary in RGWBulkUploadOp 47905/head
authorCasey Bodley <cbodley@redhat.com>
Thu, 1 Sep 2022 14:50:46 +0000 (10:50 -0400)
committerCasey Bodley <cbodley@redhat.com>
Thu, 1 Sep 2022 14:51:26 +0000 (10:51 -0400)
commite9c2ac02f1f59714677e3e1b984367df3c0ec166
tree57abf438c4bba4cdb711f469eed09c5cdc897fa8
parentf4df4090b040f1d2c2912533f0cbf5fae6fab9c4
rgw: avoid string_view to temporary in RGWBulkUploadOp

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>
src/rgw/rgw_op.cc