]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test_cls_statelog.cc: fix memory leak, delete 'rop'
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 25 Jul 2013 22:27:50 +0000 (00:27 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 26 Jul 2013 21:55:44 +0000 (23:55 +0200)
CID 1054840 (#3 of 3): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "rop" going out of scope leaks
  the storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/test/cls_statelog/test_cls_statelog.cc

index 33028f4fbad63a41db1396c6cf47a1d649946faa..a1b4cc34efcbccc872994b0c57129acf9a9c456a 100644 (file)
@@ -70,6 +70,7 @@ static void get_entries_by_object(librados::IoCtx& ioctx, string& oid,
   cls_statelog_list(*rop, empty_str, op_id, object, marker, 0, entries, &marker, &truncated);
   ASSERT_EQ(0, ioctx.operate(oid, rop, &obl));
   ASSERT_EQ(expected, (int)entries.size());
+  delete rop;
 }
 
 static void get_entries_by_client_id(librados::IoCtx& ioctx, string& oid,