From: Danny Al-Gaaf Date: Mon, 13 May 2013 11:40:03 +0000 (+0200) Subject: librbd/test_librbd.cc: free memory in test_list_children() X-Git-Tag: v0.63~29^2~16 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7ea44ee06eb22eafde4a0bafd8752d4faa541313;p=ceph.git librbd/test_librbd.cc: free memory in test_list_children() 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 --- diff --git a/src/test/librbd/test_librbd.cc b/src/test/librbd/test_librbd.cc index 0094d6504403..5f7b37bf2a52 100644 --- a/src/test/librbd/test_librbd.cc +++ b/src/test/librbd/test_librbd.cc @@ -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)