summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>2013-05-13 13:40:03 +0200
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>2013-05-14 18:39:30 +0200
commit7ea44ee06eb22eafde4a0bafd8752d4faa541313 (patch)
treed6110ce4dfb75af20cede4d0162c01439374fa55
parent3c285c44bd6bb200ed95b6714dbcff12568d9a6a (diff)
downloadceph-7ea44ee06eb22eafde4a0bafd8752d4faa541313.tar.gz
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 <danny.al-gaaf@bisect.de>
-rw-r--r--src/test/librbd/test_librbd.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/test/librbd/test_librbd.cc b/src/test/librbd/test_librbd.cc
index 0094d650440..5f7b37bf2a5 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)