]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test_cls_numops: fix iterator use
authorSage Weil <sage@redhat.com>
Fri, 4 Sep 2015 01:57:56 +0000 (21:57 -0400)
committerSage Weil <sage@redhat.com>
Fri, 4 Sep 2015 01:57:56 +0000 (21:57 -0400)
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 <sage@redhat.com>
src/test/cls_numops/test_cls_numops.cc

index 8abf110581e0f2e651ca4a8059aae8ec0bb8000c..844caf993cf1d8fde173db4711c2c154bd6597c3 100644 (file)
@@ -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);