summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>2013-07-26 00:14:59 +0200
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>2013-07-26 23:55:41 +0200
commit143b843ed1aea72d4a21a659ffee37a751eb9610 (patch)
tree0058e9657f0365cb9d45c484c1ab60309508144e
parenta90a2b42db8de134b8ea5d81cab7825fb9ec50b4 (diff)
downloadceph-143b843ed1aea72d4a21a659ffee37a751eb9610.tar.gz
test_cls_version.cc: close some memory leaks
Close some memory leaks caused by calling new() without freeing the memory already assigned to 'rop'. CID 1054848 (#1-6 of 6): Resource leak (RESOURCE_LEAK) overwrite_var: Overwriting "rop" in "rop = new_rop()" leaks the storage that "rop" points to. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
-rw-r--r--src/test/cls_version/test_cls_version.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/cls_version/test_cls_version.cc b/src/test/cls_version/test_cls_version.cc
index acce4f00cf4..4c2d59500df 100644
--- a/src/test/cls_version/test_cls_version.cc
+++ b/src/test/cls_version/test_cls_version.cc
@@ -270,14 +270,17 @@ TEST(cls_rgw, test_version_inc_check)
bufferlist bl;
ASSERT_EQ(0, ioctx.operate(oid, rop, &bl));
+ delete rop;
rop = new_rop();
cls_version_check(*rop, cond_ver, VER_COND_GE);
ASSERT_EQ(0, ioctx.operate(oid, rop, &bl));
+ delete rop;
rop = new_rop();
cls_version_check(*rop, cond_ver, VER_COND_LE);
ASSERT_EQ(0, ioctx.operate(oid, rop, &bl));
+ delete rop;
rop = new_rop();
cls_version_check(*rop, cond_ver, VER_COND_TAG_EQ);
ASSERT_EQ(0, ioctx.operate(oid, rop, &bl));
@@ -296,14 +299,17 @@ TEST(cls_rgw, test_version_inc_check)
delete op;
/* a bunch of conditions that should fail */
+ delete rop;
rop = new_rop();
cls_version_check(*rop, ver, VER_COND_LT);
ASSERT_EQ(-ECANCELED, ioctx.operate(oid, rop, &bl));
+ delete rop;
rop = new_rop();
cls_version_check(*rop, cond_ver, VER_COND_LE);
ASSERT_EQ(-ECANCELED, ioctx.operate(oid, rop, &bl));
+ delete rop;
rop = new_rop();
cls_version_check(*rop, cond_ver, VER_COND_TAG_NE);
ASSERT_EQ(-ECANCELED, ioctx.operate(oid, rop, &bl));