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

Michal Privoznik posted 1 patch 2 years, 8 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/3a7183f7a05348098328ee3eef87ee2cb2fa8d1b.1627901127.git.mprivozn@redhat.com
tests/testutils.c | 3 +++
1 file changed, 3 insertions(+)
[PATCH] testutils: Don't leak @testBitmap and @failedTests
Posted by Michal Privoznik 2 years, 8 months ago
In virTestMain() the @failedTests bitmap is allocated and
optionally @testBitmap too. But neither of them is freed.

Signed-off-by: Michal Privoznik <mprivozn@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

Re: [PATCH] testutils: Don't leak @testBitmap and @failedTests
Posted by Jano Tomko 2 years, 8 months ago
On a %A in %Y, Michal Privoznik wrote:
> In virTestMain() the @failedTests bitmap is allocated and
> optionally @testBitmap too. But neither of them is freed.
> > Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
>  tests/testutils.c | 3 +++
>  1 file changed, 3 insertions(+)
> 

Fixes: 0cd5a726e365e67690a81e3ce33ecd0cb0b5178d
Fixes: cebb468ef5e82b8d4253e27ef70c67812cf93c5a

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano

Re: [PATCH] testutils: Don't leak @testBitmap and @failedTests
Posted by Michal Prívozník 2 years, 8 months ago
On 8/2/21 2:02 PM, Jano Tomko wrote:
> On a %A in %Y, Michal Privoznik wrote:
>> In virTestMain() the @failedTests bitmap is allocated and
>> optionally @testBitmap too. But neither of them is freed.
>>> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
>> ---
>>  tests/testutils.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
> 
> Fixes: 0cd5a726e365e67690a81e3ce33ecd0cb0b5178d
> Fixes: cebb468ef5e82b8d4253e27ef70c67812cf93c5a

Ah, didn't realize that somebody might want to backport this. Amended,
thanks.

> 
> Reviewed-by: Ján Tomko <jtomko@redhat.com>
> 
> Jano
> 

Pushed, thanks.

Michal