[PATCH] testutils: Don't leak @testBitmap and @failedTests

Michal Privoznik mprivozn at redhat.com
Mon Aug 2 10:45:37 UTC 2021


In virTestMain() the @failedTests bitmap is allocated and
optionally @testBitmap too. But neither of them is freed.

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 tests/testutils.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/testutils.c b/tests/testutils.c
index 7d87e30a5c..58d3300998 100644
--- a/tests/testutils.c
+++ b/tests/testutils.c
@@ -856,6 +856,9 @@ int virTestMain(int argc,
         fprintf(stderr, "Some tests failed. Run them using:\n");
         fprintf(stderr, "VIR_TEST_DEBUG=1 VIR_TEST_RANGE=%s %s\n", failed, argv[0]);
     }
+
+    virBitmapFree(testBitmap);
+    virBitmapFree(failedTests);
     virLogReset();
     return ret;
 }
-- 
2.31.1




More information about the libvir-list mailing list