test_cls_version.cc: fix resource leak, delete before new()

CID 1049217 (#1 of 1): Resource leak (RESOURCE_LEAK)
  overwrite_var: Overwriting "op" in "op = new_op()" leaks
  the storage that "op" points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
This commit is contained in:
Danny Al-Gaaf 2013-07-22 11:39:30 +02:00
parent d3782d80d5
commit 3e94393000

View File

@ -55,6 +55,7 @@ TEST(cls_rgw, test_version_inc_read)
ASSERT_NE(0, (int)ver.tag.size());
/* inc version again! */
delete op;
op = new_op();
cls_version_inc(*op);
ASSERT_EQ(0, ioctx.operate(oid, op));