From 306d8bede63e1c1c8940bcb62d7851333145a5ad Mon Sep 17 00:00:00 2001 From: Yuval Lifshitz Date: Wed, 29 Dec 2021 12:27:43 -0500 Subject: [PATCH] notify: fix a use-after-move crash, unconstify res_id Signed-off-by: Matt Benjamin --- src/rgw/rgw_notify.cc | 2 +- src/rgw/rgw_notify.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rgw/rgw_notify.cc b/src/rgw/rgw_notify.cc index 0875987aa607f..e565f98723804 100644 --- a/src/rgw/rgw_notify.cc +++ b/src/rgw/rgw_notify.cc @@ -847,7 +847,7 @@ int publish_commit(rgw::sal::Object* obj, event_entry.push_endpoint = std::move(topic.cfg.dest.push_endpoint); event_entry.push_endpoint_args = std::move(topic.cfg.dest.push_endpoint_args); - event_entry.arn_topic = std::move(topic.cfg.dest.arn_topic); + event_entry.arn_topic = topic.cfg.dest.arn_topic; bufferlist bl; encode(event_entry, bl); const auto& queue_name = topic.cfg.dest.arn_topic; diff --git a/src/rgw/rgw_notify.h b/src/rgw/rgw_notify.h index 6470e26783388..44e16f751efbf 100644 --- a/src/rgw/rgw_notify.h +++ b/src/rgw/rgw_notify.h @@ -44,7 +44,7 @@ int remove_persistent_topic(const std::string& topic_name, optional_yield y); struct reservation_t { struct topic_t { topic_t(const std::string& _configurationId, const rgw_pubsub_topic& _cfg, - const cls_2pc_reservation::id_t _res_id) : + cls_2pc_reservation::id_t _res_id) : configurationId(_configurationId), cfg(_cfg), res_id(_res_id) {} std::string configurationId; -- 2.39.5