You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bb...@apache.org on 2018/09/25 20:59:25 UTC

[mesos] 02/02: Fixed accidental use-after-move.

This is an automated email from the ASF dual-hosted git repository.

bbannier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit 501c987c33861add6dca7841502fdc62c0646a8f
Author: Benjamin Bannier <be...@mesosphere.io>
AuthorDate: Tue Sep 25 21:00:48 2018 +0200

    Fixed accidental use-after-move.
    
    This code was incorrectly accessing an object after it was moved from.
    This patch fixes the typo which lead to that behavior.
    
    Review: https://reviews.apache.org/r/68818/
---
 src/tests/resources_tests.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/tests/resources_tests.cpp b/src/tests/resources_tests.cpp
index 002338a..ab42374 100644
--- a/src/tests/resources_tests.cpp
+++ b/src/tests/resources_tests.cpp
@@ -804,7 +804,7 @@ TEST(ResourcesTest, MoveConstruction)
 
   // Move constructor for `Resources`.
   Resources r1 = r;
-  Resources rr1{std::move(r)};
+  Resources rr1{std::move(r1)};
   EXPECT_EQ(r, rr1);
 
   // Move constructor for `vector<Resource>`.