]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/librados/aio.cc: delete AioCompletion* before return
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 14 Nov 2014 14:39:19 +0000 (15:39 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 7 Jan 2015 09:14:10 +0000 (10:14 +0100)
CID 1242018: Resource leak (RESOURCE_LEAK)
 leaked_storage: Variable aio_completion going out of scope leaks
 the storage it points to.

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

index 86e490bb1074a13d4b16ce7fe33284813d3f2015..eb86afcba64fffb3fbd452ff5d75936a1a12a4b4 100644 (file)
@@ -187,6 +187,7 @@ TEST(LibRadosAio, TooBigPP) {
   ASSERT_EQ(-E2BIG, test_data.m_ioctx.aio_write("foo", aio_completion, bl, UINT_MAX, 0));
   ASSERT_EQ(-E2BIG, test_data.m_ioctx.aio_append("foo", aio_completion, bl, UINT_MAX));
   // ioctx.aio_write_full no way to overflow bl.length()
+  delete aio_completion;
 }
 
 TEST(LibRadosAio, SimpleWrite) {