]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd/test_librbd.cc: free memory in test_list_children()
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Mon, 13 May 2013 11:40:03 +0000 (13:40 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Tue, 14 May 2013 16:39:30 +0000 (18:39 +0200)
CID 719581 (#7 of 7): Resource leak (RESOURCE_LEAK)
CID 719581 (#6 of 7): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "pools" going out of scope leaks the
  storage it points to.
CID 719582 (#6-7 of 7): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "children" going out of scope leaks
  the storage it points to.

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

index 0094d6504403bf7a1dcf49934a4135d7d57d8e88..5f7b37bf2a52c959352ec6b6ca5adac31d17ff9c 100644 (file)
@@ -1248,6 +1248,11 @@ static void test_list_children(rbd_image_t image, ssize_t num_expected, ...)
     ASSERT_TRUE(found);
   }
   va_end(ap);
+
+  if (pools)
+    free(pools);
+  if (children)
+    free(children);
 }
 
 TEST(LibRBD, ListChildren)