[libvirt] [PATCH 7/8] qemuhotplugtest: Don't leak @vm

Michal Privoznik posted 8 patches 7 years, 9 months ago
[libvirt] [PATCH 7/8] qemuhotplugtest: Don't leak @vm
Posted by Michal Privoznik 7 years, 9 months ago
Some tests take already prepared domain from previous tests. In
this case, the domain is freed by the first test that doesn't
keep the domain. However, if there's no such test case domain is
leaked.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 tests/qemuhotplugtest.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
index 79f032690..23a498617 100644
--- a/tests/qemuhotplugtest.c
+++ b/tests/qemuhotplugtest.c
@@ -855,6 +855,7 @@ mymain(void)
     DO_TEST_CPU_INDIVIDUAL("ppc64-modern-individual", "17", true, true, true);
 
     qemuTestDriverFree(&driver);
+    virObjectUnref(data.vm);
     return (ret == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
 }
 
-- 
2.13.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 7/8] qemuhotplugtest: Don't leak @vm
Posted by Peter Krempa 7 years, 9 months ago
On Fri, Aug 04, 2017 at 16:22:35 +0200, Michal Privoznik wrote:
> Some tests take already prepared domain from previous tests. In
> this case, the domain is freed by the first test that doesn't
> keep the domain. However, if there's no such test case domain is
> leaked.
> 
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
>  tests/qemuhotplugtest.c | 1 +
>  1 file changed, 1 insertion(+)

ACK
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list