]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tools/rados: assign to optional<> without deref'ing it 39667/head
authorKefu Chai <kchai@redhat.com>
Wed, 24 Feb 2021 14:24:50 +0000 (22:24 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 24 Feb 2021 14:24:51 +0000 (22:24 +0800)
this change addresses a regression introduced by
d333b35aa10bf03a8bc047994d5cf3fed019b49a

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/tools/rados/rados.cc

index ec4c6a557d59b1e6e415f1764cc39878fc659b1b..7564fc7f0f2ad7bfc38253392412b95865fac55f 100644 (file)
@@ -2723,7 +2723,7 @@ static int rados_tool_common(const std::map < std::string, std::string > &opts,
     }
     string attr_name(nargs[obj_name ? 1 : 2]);
     if (!obj_name) {
-      *obj_name = nargs[1];
+      obj_name = nargs[1];
     }
     bufferlist bl;
     ret = detail::getxattr(io_ctx, *obj_name, attr_name, bl, use_striper);
@@ -2744,7 +2744,7 @@ static int rados_tool_common(const std::map < std::string, std::string > &opts,
 
     string attr_name(nargs[obj_name ? 1 : 2]);
     if (!obj_name) {
-      *obj_name = nargs[1];
+      obj_name = nargs[1];
     }
     ret = detail::rmxattr(io_ctx, *obj_name, attr_name, use_striper);