]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/crimson: should not capture temporary variables
authorKefu Chai <kchai@redhat.com>
Mon, 11 Feb 2019 15:23:08 +0000 (23:23 +0800)
committerYingxin Cheng <yingxincheng@gmail.com>
Tue, 12 Feb 2019 16:03:31 +0000 (00:03 +0800)
otherwise, we are passing dangling pointers down to
`app_template::run()`.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/test/crimson/test_alien_echo.cc

index ad91f74078a3380213244292306ba12320e6bd08..2000b590ad34d328b69158c84ea2b6109a88e69a 100644 (file)
@@ -417,7 +417,7 @@ int main(int argc, char** argv)
     std::transform(begin(unrecognized_options),
                    end(unrecognized_options),
                    std::back_inserter(av),
-                   [](auto s) {
+                   [](auto& s) {
                      return const_cast<char*>(s.c_str());
                    });
     sc.run(app, av.size(), av.data());