From: Sage Weil Date: Fri, 4 Sep 2015 01:57:56 +0000 (-0400) Subject: test_cls_numops: fix iterator use X-Git-Tag: v9.1.0~223^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c3d379429e9d63e573e6ef820895c44f778e6dd6;p=ceph.git test_cls_numops: fix iterator use CID 1322828 (#1 of 1): Wrapper object use after free (WRAPPER_ESCAPE) 28. use_after_free: Using invalidated internal representation of local it. CID 1322827 (#1 of 1): Wrapper object use after free (WRAPPER_ESCAPE) 25. use_after_free: Using invalidated internal representation of local it. CID 1322826 (#1 of 1): Wrapper object use after free (WRAPPER_ESCAPE) 31. use_after_free: Using invalidated internal representation of local it. CID 1322825 (#1 of 1): Wrapper object use after free (WRAPPER_ESCAPE) 31. use_after_free: Using invalidated internal representation of local it. Signed-off-by: Sage Weil --- diff --git a/src/test/cls_numops/test_cls_numops.cc b/src/test/cls_numops/test_cls_numops.cc index 8abf110581e0f..844caf993cf1d 100644 --- a/src/test/cls_numops/test_cls_numops.cc +++ b/src/test/cls_numops/test_cls_numops.cc @@ -77,7 +77,7 @@ TEST(ClsNumOps, Add) { ASSERT_EQ(0, ioctx.omap_get_vals_by_keys("myobject", keys, &omap)); - omap.find(key); + it = omap.find(key); ASSERT_NE(omap.end(), it); @@ -166,7 +166,7 @@ TEST(ClsNumOps, Sub) { ASSERT_EQ(0, ioctx.omap_get_vals_by_keys("myobject", keys, &omap)); - omap.find(key); + it = omap.find(key); ASSERT_NE(omap.end(), it); @@ -269,7 +269,7 @@ TEST(ClsNumOps, Mul) { ASSERT_EQ(0, ioctx.omap_get_vals_by_keys("myobject", keys, &omap)); - omap.find(key); + it = omap.find(key); ASSERT_NE(omap.end(), it); @@ -370,7 +370,7 @@ TEST(ClsNumOps, Div) { ASSERT_EQ(0, ioctx.omap_get_vals_by_keys("myobject", keys, &omap)); - omap.find(key); + it = omap.find(key); ASSERT_NE(omap.end(), it);